Commit 51ec502a authored by Bart Van Assche's avatar Bart Van Assche Committed by Nicholas Bellinger

target: Delete tmr from list before processing

This patch does an explicit list_del_init(tmr->tmr_list) in
core_tmr_drain_tmr_list() before starting processing of
outstanding TMRs to abort, instead of explicitly checking
which TMR descriptor matches the caller.
Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: David Disseldorp <ddiss@suse.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent e3b88ee9
...@@ -215,13 +215,8 @@ static void core_tmr_drain_tmr_list( ...@@ -215,13 +215,8 @@ static void core_tmr_drain_tmr_list(
* LUN_RESET tmr.. * LUN_RESET tmr..
*/ */
spin_lock_irqsave(&dev->se_tmr_lock, flags); spin_lock_irqsave(&dev->se_tmr_lock, flags);
list_del_init(&tmr->tmr_list);
list_for_each_entry_safe(tmr_p, tmr_pp, &dev->dev_tmr_list, tmr_list) { list_for_each_entry_safe(tmr_p, tmr_pp, &dev->dev_tmr_list, tmr_list) {
/*
* Allow the received TMR to return with FUNCTION_COMPLETE.
*/
if (tmr_p == tmr)
continue;
cmd = tmr_p->task_cmd; cmd = tmr_p->task_cmd;
if (!cmd) { if (!cmd) {
pr_err("Unable to locate struct se_cmd for TMR\n"); pr_err("Unable to locate struct se_cmd for TMR\n");
......
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