Skip to contentSkip to conversation

bfa: set correct command return code

PATCH In review Hannes Reinecke 2 participants 2 messages Jan 14, 2014 – Jan 22, 2014

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

PATCH 1/1 bfa: set correct command return code

For various error conditions the bfa driver just returns 'DID_ERROR', which carries no information at all about the actual source of error.
This patch updates the error handling to return a correct error code, depending on the type of error occurred.

---
 drivers/scsi/bfa/bfad_im.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/scsi/bfa/bfad_im.c +6 -1
index 9967f9c..f067332 100644
@@ -73,9 +73,14 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio,
 
 		break;
 
-	case BFI_IOIM_STS_ABORTED:
 	case BFI_IOIM_STS_TIMEDOUT:
+		host_status = DID_TIME_OUT;
+		cmnd->result = ScsiResult(host_status, 0);
+		break;
 	case BFI_IOIM_STS_PATHTOV:
+		host_status = DID_TRANSPORT_DISRUPTED;
+		cmnd->result = ScsiResult(host_status, 0);
+		break;
 	default:
 		host_status = DID_ERROR;
 		cmnd->result = ScsiResult(host_status, 0);
Signature · 1 line
1.7.12.4
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: Hannes Reinecke [mailto:[email protected]]
Sent: Tuesday, January 14, 2014 2:56 PM
To: James Bottomley
Cc: [email protected]; Vijaya Mohan Guvva; Hannes Reinecke
Subject: [PATCH] bfa: set correct command return code

For various error conditions the bfa driver just returns 'DID_ERROR', which carries no information at all about the actual source of error. This patch updates the error handling to return a correct error code, depending on the type of error occurred.

Thanks Hannes, Changes looks good to me.