Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: storvsc: fix SRB_STATUS_ABORTED handling

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>

authored by

Vitaly Kuznetsov and committed by
Martin K. Petersen
bb017d03 a41b2efb

+3 -2
+3 -2
drivers/scsi/storvsc_drv.c
··· 914 914 do_work = true; 915 915 process_err_fn = storvsc_remove_lun; 916 916 break; 917 - case (SRB_STATUS_ABORTED | SRB_STATUS_AUTOSENSE_VALID): 918 - if ((asc == 0x2a) && (ascq == 0x9)) { 917 + case SRB_STATUS_ABORTED: 918 + if (vm_srb->srb_status & SRB_STATUS_AUTOSENSE_VALID && 919 + (asc == 0x2a) && (ascq == 0x9)) { 919 920 do_work = true; 920 921 process_err_fn = storvsc_device_scan; 921 922 /*