scsi: storvsc: fix SRB_STATUS_ABORTED handling
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 7 Mar 2016 10:59:44 +0000 (11:59 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 14 Mar 2016 19:50:16 +0000 (15:50 -0400)
Commit 3209f9d780d1 ("scsi: storvsc: Fix a bug in the handling of SRB
status flags") filtered SRB_STATUS_AUTOSENSE_VALID out effectively making
the (SRB_STATUS_ABORTED | SRB_STATUS_AUTOSENSE_VALID) case a dead code. The
logic from this branch (e.g. storvsc_device_scan() call) is still required,
fix the check.

Cc: <stable@vger.kernel.org> #v4.4+
Fixes: 3209f9d780d1 ("scsi: storvsc: Fix a bug in the handling of SRB status flags")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Acked-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/storvsc_drv.c

index 292c04eec9ad4b56518afc243d92b37602a3f456..3ddcabb790a892f5383379f985b8b26ff7bd76c0 100644 (file)
@@ -914,8 +914,9 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb,
                do_work = true;
                process_err_fn = storvsc_remove_lun;
                break;
-       case (SRB_STATUS_ABORTED | SRB_STATUS_AUTOSENSE_VALID):
-               if ((asc == 0x2a) && (ascq == 0x9)) {
+       case SRB_STATUS_ABORTED:
+               if (vm_srb->srb_status & SRB_STATUS_AUTOSENSE_VALID &&
+                   (asc == 0x2a) && (ascq == 0x9)) {
                        do_work = true;
                        process_err_fn = storvsc_device_scan;
                        /*