Skip to contentSkip to conversation

scsi: storvsc: fix SRB_STATUS_ABORTED handling

PATCH Applied Vitaly Kuznetsov 3 participants 3 messages Mar 7, 2016 – Mar 9, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

Fixes 3209f9d780d1 ("scsi: storvsc: Fix a bug in the handling of SRB status flags")
---
 drivers/scsi/storvsc_drv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/storvsc_drv.c +3 -2
index 292c04e..3ddcabb 100644
@@ -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;
 			/*
Signature · 1 line
2.5.0
Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines

-----Original Message-----
From: Vitaly Kuznetsov [mailto:[email protected]]
Sent: Monday, March 7, 2016 3:00 AM
To: [email protected]
Cc: [email protected]; [email protected]; KY Srinivasan <[email protected]>; Haiyang Zhang <[email protected]>; Cathy Avery <[email protected]>; James E.J. Bottomley <[email protected]>; Martin K. Petersen" <[email protected]>
Subject: [PATCH] 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.

Quoted 3 lines
Fixes 3209f9d780d1 ("scsi: storvsc: Fix a bug in the handling of SRB status

flags")

Thanks Vitaly.

Quoted 24 lines
---
 drivers/scsi/storvsc_drv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/storvsc_drv.c +2 -2
index 292c04e..3ddcabb 100644
@@ -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

&&

drivers/scsi/storvsc_drv.c +1 -1
+		    (asc == 0x2a) && (ascq == 0x9)) {
 			do_work = true;
 			process_err_fn = storvsc_device_scan;
 			/*
--

2.5.0

#2 lore raw
In reply to Vitaly Kuznetsov
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Vitaly" == Vitaly Kuznetsov <[email protected]> writes:

Vitaly> Commit 3209f9d780d1 ("scsi: storvsc: Fix a bug in the handling Vitaly> of SRB status flags") filtered SRB_STATUS_AUTOSENSE_VALID out Vitaly> effectively making the (SRB_STATUS_ABORTED |
Vitaly> SRB_STATUS_AUTOSENSE_VALID) case a dead code. The logic from Vitaly> this branch (e.g. storvsc_device_scan() call) is still required, Vitaly> fix the check.

Applied to 4.5/scsi-fixes.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering