]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nvme: report the scsi TUR state correctly
authorShan Hai <shan.hai@oracle.com>
Tue, 17 Oct 2017 09:50:03 +0000 (17:50 +0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 23 Oct 2017 04:33:15 +0000 (21:33 -0700)
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 <shan.hai@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/nvme/host/scsi.c

index e947e298a737b17a5267071a9102dbc7da72f6cb..332f37fad89c35516e08624385fb46437cbac9c5 100644 (file)
@@ -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);