summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2011-11-02 13:06:35 +0100
committerNicholas Bellinger <nab@linux-iscsi.org>2011-11-02 17:21:10 +0100
commit2235007c4d3245c0eca5e49497aafe5a111c00fb (patch)
treedc7af94f5ac99d6558098b4fca2ed14d6ba828dc /drivers/target
parenttarget/pscsi: blk_make_request() returns an ERR_PTR() (diff)
downloadlinux-2235007c4d3245c0eca5e49497aafe5a111c00fb.tar.xz
linux-2235007c4d3245c0eca5e49497aafe5a111c00fb.zip
target: add back error handling in transport_complete_task
The commit target: use a workqueue for I/O completions accidentally removed setting t_tasks_failed in transport_complete_task. Add it back in a slightly cleaner way; now it is set for every failed task instead of special casing the last one completing by using the success argument directly for it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_transport.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 64ee3342e0c2..81bc355be317 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -733,6 +733,10 @@ void transport_complete_task(struct se_task *task, int success)
complete(&task->task_stop_comp);
return;
}
+
+ if (!success)
+ cmd->t_tasks_failed = 1;
+
/*
* Decrement the outstanding t_task_cdbs_left count. The last
* struct se_task from struct se_cmd will complete itself into the
@@ -743,7 +747,7 @@ void transport_complete_task(struct se_task *task, int success)
return;
}
- if (!success || cmd->t_tasks_failed) {
+ if (cmd->t_tasks_failed) {
if (!task->task_error_status) {
task->task_error_status =
PYX_TRANSPORT_UNKNOWN_SAM_OPCODE;