diff options
author | Roland Dreier <roland@purestorage.com> | 2012-07-16 14:04:39 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-07-17 20:05:05 -0400 |
commit | d6dfc868bcf329392abd1ecfa7357eb51ebf8c30 (patch) | |
tree | 7eb33785e4d6a59111560b56e68f4facaddee310 /drivers/target/sbp | |
parent | 7409a6657aebf8be74c21d0eded80709b27275cb (diff) |
target: Allow for target_submit_cmd() returning errors
We want it to be possible for target_submit_cmd() to return errors up
to its fabric module callers. For now just update the prototype to
return an int, and update all callers to handle non-zero return values
as an error.
This is immediately useful for tcm_qla2xxx to fix a long-standing active
I/O session shutdown race, but tcm_fc, usb-gadget, and sbp-target the
fabric maintainers need to check + ACK that handling a target_submit_cmd()
failure due to session shutdown does not introduce regressions
(nab: Respin against for-next after initial NACK + update docbook comment +
fix double se_cmd init in exception path for usb-gadget)
Cc: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Cc: Chris Boot <bootc@bootc.net>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: Mark Rustad <mark.d.rustad@intel.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Andy Grover <agrover@redhat.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/sbp')
-rw-r--r-- | drivers/target/sbp/sbp_target.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c index e10e6223e96c..39ddba584b30 100644 --- a/drivers/target/sbp/sbp_target.c +++ b/drivers/target/sbp/sbp_target.c | |||
@@ -1235,9 +1235,11 @@ static void sbp_handle_command(struct sbp_target_request *req) | |||
1235 | pr_debug("sbp_handle_command ORB:0x%llx unpacked_lun:%d data_len:%d data_dir:%d\n", | 1235 | pr_debug("sbp_handle_command ORB:0x%llx unpacked_lun:%d data_len:%d data_dir:%d\n", |
1236 | req->orb_pointer, unpacked_lun, data_length, data_dir); | 1236 | req->orb_pointer, unpacked_lun, data_length, data_dir); |
1237 | 1237 | ||
1238 | target_submit_cmd(&req->se_cmd, sess->se_sess, req->cmd_buf, | 1238 | if (target_submit_cmd(&req->se_cmd, sess->se_sess, req->cmd_buf, |
1239 | req->sense_buf, unpacked_lun, data_length, | 1239 | req->sense_buf, unpacked_lun, data_length, |
1240 | MSG_SIMPLE_TAG, data_dir, 0); | 1240 | MSG_SIMPLE_TAG, data_dir, 0)) |
1241 | goto err; | ||
1242 | |||
1241 | return; | 1243 | return; |
1242 | 1244 | ||
1243 | err: | 1245 | err: |