aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorAlex Leung <alex.leung@emulex.com>2014-04-04 00:38:19 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2014-04-11 18:27:15 -0400
commit47b1584c1c95f0bb4d646c47de1c0455bb5cef54 (patch)
tree62c12ddafcdba8431c125dd89ea5c49cdf9dffaa /drivers/target
parentbc0058695a74c0e9aef8bf9582a096ce4924f690 (diff)
target: Add check to prevent Abort Task from aborting itself
This patch addresses an issue that occurs when an ABTS is received for an se_cmd that completes just before the sess_cmd_list is searched in core_tmr_abort_task(). When the sess_cmd_list is searched, since the ABTS and the FCP_CMND being aborted (that just completed) both have the same OXID, TFO->get_task_tag(TMR) returns a value that matches tmr->ref_task_tag (from TFO->get_task_tag(FCP_CMND)), and the Abort Task tries to abort itself. When this occurs, transport_wait_for_tasks() hangs forever since the TMR is waiting for itself to finish. This patch adds a check to core_tmr_abort_task() to make sure the TMR does not attempt to abort itself. Signed-off-by: Alex Leung <alex.leung@emulex.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_tmr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index 3f0338fff240..f7cd95e8111a 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
@@ -130,6 +130,11 @@ void core_tmr_abort_task(
130 130
131 if (dev != se_cmd->se_dev) 131 if (dev != se_cmd->se_dev)
132 continue; 132 continue;
133
134 /* skip se_cmd associated with tmr */
135 if (tmr->task_cmd == se_cmd)
136 continue;
137
133 ref_tag = se_cmd->se_tfo->get_task_tag(se_cmd); 138 ref_tag = se_cmd->se_tfo->get_task_tag(se_cmd);
134 if (tmr->ref_task_tag != ref_tag) 139 if (tmr->ref_task_tag != ref_tag)
135 continue; 140 continue;