From 5ea603cbd4a676b1148a7b1a5e4c68e9053d3547 Mon Sep 17 00:00:00 2001 From: Shan Hai Date: Tue, 17 Oct 2017 17:50:03 +0800 Subject: [PATCH] nvme: report the scsi TUR state correctly Orabug: 26993705 The current nvme driver reports the scsi TEST UNIT READY state upside down because of the inconsistency between the condition checking and the return value, fix it by making it consistent. Signed-off-by: Shan Hai Reviewed-by: Martin K. Petersen --- drivers/nvme/host/scsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/scsi.c b/drivers/nvme/host/scsi.c index e947e298a737..332f37fad89c 100644 --- a/drivers/nvme/host/scsi.c +++ b/drivers/nvme/host/scsi.c @@ -2315,7 +2315,7 @@ static int nvme_trans_test_unit_ready(struct nvme_ns *ns, struct sg_io_hdr *hdr, u8 *cmd) { - if (nvme_ctrl_ready(ns->ctrl)) + if (!nvme_ctrl_ready(ns->ctrl)) return nvme_trans_completion(hdr, SAM_STAT_CHECK_CONDITION, NOT_READY, SCSI_ASC_LUN_NOT_READY, SCSI_ASCQ_CAUSE_NOT_REPORTABLE); -- 2.50.1