Commit 3a1e7ca6 authored by Bart Van Assche's avatar Bart Van Assche Committed by Nicholas Bellinger

target: Make core_tmr_abort_task() consider all commands

It is possible that two commands with the same tag are present on
sess_cmd_list because commands are removed from sess_cmd_list after
a response has been sent to the initiator. Hence continue searching
through sess_cmd_list even if a matching tag has already been found.
Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: Himanshu Madhani <himanshu.madhani@cavium.com>
Cc: Giridhar Malavali <giridhar.malavali@cavium.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 4f4c6c3d
...@@ -175,10 +175,9 @@ void core_tmr_abort_task( ...@@ -175,10 +175,9 @@ void core_tmr_abort_task(
printk("ABORT_TASK: Found referenced %s task_tag: %llu\n", printk("ABORT_TASK: Found referenced %s task_tag: %llu\n",
se_cmd->se_tfo->get_fabric_name(), ref_tag); se_cmd->se_tfo->get_fabric_name(), ref_tag);
if (!__target_check_io_state(se_cmd, se_sess, 0)) { if (!__target_check_io_state(se_cmd, se_sess, 0))
spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); continue;
goto out;
}
list_del_init(&se_cmd->se_cmd_list); list_del_init(&se_cmd->se_cmd_list);
spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags);
...@@ -195,7 +194,6 @@ void core_tmr_abort_task( ...@@ -195,7 +194,6 @@ void core_tmr_abort_task(
} }
spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags);
out:
printk("ABORT_TASK: Sending TMR_TASK_DOES_NOT_EXIST for ref_tag: %lld\n", printk("ABORT_TASK: Sending TMR_TASK_DOES_NOT_EXIST for ref_tag: %lld\n",
tmr->ref_task_tag); tmr->ref_task_tag);
tmr->response = TMR_TASK_DOES_NOT_EXIST; tmr->response = TMR_TASK_DOES_NOT_EXIST;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment