Skip to contentSkip to conversation

ibmvscsis: Fix srp_transfer_data fail return code

PATCH In review Bryant G. Ly 3 participants 5 messages Jan 9, 2017 – Jan 10, 2017

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

PATCH 1/1 ibmvscsis: Fix srp_transfer_data fail return code

From: "Bryant G. Ly" <[email protected]>

If srp_transfer_data fails within ibmvscsis_write_pending, then the most likely scenario is that the client timed out the op and removed the TCE mapping. Thus it will loop forever retrying the op that is pretty much guaranteed to fail forever. A better return code would be EIO instead of EAGAIN.

---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +1 -1
index 3d3768a..8fb5c54 100644
@@ -3585,7 +3585,7 @@ static int ibmvscsis_write_pending(struct se_cmd *se_cmd)
 			       1, 1);
 	if (rc) {
 		pr_err("srp_transfer_data() failed: %d\n", rc);
-		return -EAGAIN;
+		return -EIO;
 	}
 	/*
 	 * We now tell TCM to add this WRITE CDB directly into the TCM storage
Signature · 1 line
2.5.4 (Apple Git-61)
maintainer
#1 lore raw
Quoted 8 lines · Bryant G. Ly

From: "Bryant G. Ly" <[email protected]>

If srp_transfer_data fails within ibmvscsis_write_pending, then the most likely scenario is that the client timed out the op and removed the TCE mapping. Thus it will loop forever retrying the op that is pretty much guaranteed to fail forever. A better return code would be EIO instead of EAGAIN.

Quoted 7 lines
---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Why are you sending this to me?

confused,

greg k-h

#2 lore raw
Quoted 16 lines · Greg KH
Quoted 8 lines · Bryant G. Ly

From: "Bryant G. Ly" <[email protected]>

If srp_transfer_data fails within ibmvscsis_write_pending, then the most likely scenario is that the client timed out the op and removed the TCE mapping. Thus it will loop forever retrying the op that is pretty much guaranteed to fail forever. A better return code would be EIO instead of EAGAIN.

Quoted 7 lines
---
  drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 5 lines

Why are you sending this to me?

confused,

greg k-h

Sorry I meant to put --to [email protected], and just --cc you.

-Bryant

maintainer
#3 lore raw
Quoted 18 lines · Bryant G. Ly
Quoted 16 lines · Greg KH
Quoted 15 lines · Bryant G. Ly

From: "Bryant G. Ly" <[email protected]>

If srp_transfer_data fails within ibmvscsis_write_pending, then the most likely scenario is that the client timed out the op and removed the TCE mapping. Thus it will loop forever retrying the op that is pretty much guaranteed to fail forever. A better return code would be EIO instead of EAGAIN.

---
  drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 6 lines
Quoted 5 lines

Why are you sending this to me?

confused,

greg k-h

Sorry I meant to put --to [email protected], and just --cc you.

Why even cc: me?

#4 lore raw
In reply to Bryant G. Ly
Quoted 21 lines · Bryant G. Ly

From: "Bryant G. Ly" <[email protected]>

If srp_transfer_data fails within ibmvscsis_write_pending, then the most likely scenario is that the client timed out the op and removed the TCE mapping. Thus it will loop forever retrying the op that is pretty much guaranteed to fail forever. A better return code would be EIO instead of EAGAIN.

---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +0 -0
index 3d3768a..8fb5c54 100644

drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c static int ibmvscsis_write_pending(struct se_cmd *se_cmd) · line 3591

Quoted 8 lines
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +1 -1
@@ -3585,7 +3585,7 @@ static int ibmvscsis_write_pending(struct se_cmd *se_cmd)
  			       1, 1);
  	if (rc) {
  		pr_err("srp_transfer_data() failed: %d\n", rc);
-		return -EAGAIN;
+		return -EIO;
  	}
  	/*
  	 * We now tell TCM to add this WRITE CDB directly into the TCM storage

Using the "Cc: [email protected]" tag is fine but please do not add [email protected] to the CC-list of the e-mail header. Anyway, thanks for the patch. It has been applied on my for-v4.10 branch.

Bart.