diff mbox

[2/3] storvsc: properly handle SRB_ERROR when sense message is present

Message ID 1473197143-16760-3-git-send-email-longli@exchange.microsoft.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Long Li Sept. 6, 2016, 9:25 p.m. UTC
From: Long Li <longli@microsoft.com>

When sense message is present on error, we should pass along to the upper layer to decide how to deal with the error. This patch fixes connectivity issues with Fiber Channel devices.

---
 drivers/scsi/storvsc_drv.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox

Patch

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index a8f3e4c..8328c87 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -890,6 +890,9 @@  static void storvsc_handle_error(struct vmscsi_request *vm_srb,
 
 	switch (SRB_STATUS(vm_srb->srb_status)) {
 	case SRB_STATUS_ERROR:
+		/* Let upper layer deal with error when sense message is present */
+		if (vm_srb->srb_status & SRB_STATUS_AUTOSENSE_VALID)
+			break;
 		/*
 		 * If there is an error; offline the device since all
 		 * error recovery strategies would have already been