aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-02-13 05:35:01 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 17:37:49 -0500
commitffc32d5259d107a3aa1b822e22f20b69cb9ec0a5 (patch)
tree770ec5b87b91c9c1bc7edd76c8a1535259424696 /drivers/target
parent86715569d085addc635c2b55ee8acb79d3a7fbbf (diff)
target: Make target_release_cmd_kref release on empty list
This patch changes target_release_cmd_kref() to make TFO->release_cmd() call when list_empty(&se_cmd->se_cmd_list) is TRUE. This is required for TMR_ABORT_TASK operation where the referenced tag descriptor may have already been pulled of the session command list. Reported-by: Roland Dreier <roland@purestorage.com> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/target_core_transport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index c6b8b8233399..52a66710a293 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -4051,7 +4051,7 @@ static void target_release_cmd_kref(struct kref *kref)
4051 spin_lock_irqsave(&se_sess->sess_cmd_lock, flags); 4051 spin_lock_irqsave(&se_sess->sess_cmd_lock, flags);
4052 if (list_empty(&se_cmd->se_cmd_list)) { 4052 if (list_empty(&se_cmd->se_cmd_list)) {
4053 spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); 4053 spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags);
4054 WARN_ON(1); 4054 se_cmd->se_tfo->release_cmd(se_cmd);
4055 return; 4055 return;
4056 } 4056 }
4057 if (se_sess->sess_tearing_down && se_cmd->cmd_wait_set) { 4057 if (se_sess->sess_tearing_down && se_cmd->cmd_wait_set) {