Skip to content

Commit

Permalink
target: add back error handling in transport_complete_task
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Nicholas Bellinger committed Nov 2, 2011
1 parent ed327ed commit 2235007
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down

0 comments on commit 2235007

Please sign in to comment.