diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-06-09 19:13:20 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-06-10 00:15:59 -0400 |
commit | f15e9cd910c4d9da7de43f2181f362082fc45f0f (patch) | |
tree | 7dce162b7e33dfebaadccfbf0177fc9edb90e240 | |
parent | 0bcc297e2b45c12baf735e1dc1f163e71ea55e16 (diff) |
target: Set CMD_T_ACTIVE bit for Task Management Requests
This patch fixes a bug where se_cmd descriptors associated with a
Task Management Request (TMR) where not setting CMD_T_ACTIVE before
being dispatched into target_tmr_work() process context.
This is required in order for transport_generic_free_cmd() ->
transport_wait_for_tasks() to wait on se_cmd->t_transport_stop_comp
if a session reset event occurs while an ABORT_TASK is outstanding
waiting for another I/O to complete.
Cc: Thomas Glanzmann <thomas@glanzmann.de>
Cc: Charalampos Pournaris <charpour@gmail.com>
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_transport.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 5f192cafbb79..195435bf1140 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -2934,6 +2934,12 @@ static void target_tmr_work(struct work_struct *work) | |||
2934 | int transport_generic_handle_tmr( | 2934 | int transport_generic_handle_tmr( |
2935 | struct se_cmd *cmd) | 2935 | struct se_cmd *cmd) |
2936 | { | 2936 | { |
2937 | unsigned long flags; | ||
2938 | |||
2939 | spin_lock_irqsave(&cmd->t_state_lock, flags); | ||
2940 | cmd->transport_state |= CMD_T_ACTIVE; | ||
2941 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | ||
2942 | |||
2937 | INIT_WORK(&cmd->work, target_tmr_work); | 2943 | INIT_WORK(&cmd->work, target_tmr_work); |
2938 | queue_work(cmd->se_dev->tmr_wq, &cmd->work); | 2944 | queue_work(cmd->se_dev->tmr_wq, &cmd->work); |
2939 | return 0; | 2945 | return 0; |