Skip to contentSkip to conversation

Set correct completion code in scsi_send_eh_cmnd()

PATCH In review Hannes Reinecke 2 participants 2 messages May 8, 2014 – May 15, 2014 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Set correct completion code in scsi_send_eh_cmnd()

->queuecommand returns '0' for successful command submission, so we need to set the correct SCSI midlayer return value when calling scsi_log_completion().

---
 drivers/scsi/scsi_error.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/scsi_error.c +1 -0
index f17aa7a..f4e0cad 100644
@@ -1029,6 +1029,7 @@ retry:
 		rtn = NEEDS_RETRY;
 	} else {
 		timeleft = wait_for_completion_timeout(&done, timeout);
+		rtn = SUCCESS;
 	}
 
 	shost->eh_action = NULL;
Signature · 1 line
1.7.12.4
#1 lore raw
Quoted 32 lines

-----Original Message-----
From: [email protected] [mailto:linux-scsi- [email protected]] On Behalf Of Hannes Reinecke
Sent: Thursday, May 08, 2014 1:10 AM
To: James Bottomley
Cc: [email protected]; Hannes Reinecke; Stephen Cameron
Subject: [PATCH] Set correct completion code in scsi_send_eh_cmnd()

->queuecommand returns '0' for successful command submission, so we need to set the correct SCSI midlayer return value when calling scsi_log_completion().

---
 drivers/scsi/scsi_error.c | 1 +
 1 file changed, 1 insertion(+)
drivers/scsi/scsi_error.c +1 -1
index f17aa7a..f4e0cad 100644
@@ -1029,6 +1029,7 @@ retry:
 		rtn = NEEDS_RETRY;
 	} else {
 		timeleft = wait_for_completion_timeout(&done, timeout);
+		rtn = SUCCESS;
 	}
 
 	shost->eh_action = NULL;
--
Quoted 1 line

1.7.12.4

I've confirmed that patch successfully gets rid of bogus reporting of "UNKNOWN" for successfully submitted commands from that function, correcting the use of "internal return values" vs. "midlayer return values."

 [ 5454.381659] sd 2:0:0:1: [sds] scsi_eh_2: requesting sense
[ 5454.383597] scsi_eh_done scmd: ffff880428963a70 result: 0
[ 5454.385457] sd 2:0:0:1: [sds] Done: UNKNOWN
[ 5454.387430] sd 2:0:0:1: [sds] Result: hostbyte=DID_OK driverbyte=DRIVER_OK