Skip to content

Commit 51ec502

Browse files
Bart Van AsscheNicholas Bellinger
authored andcommitted
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: Bart Van Assche <[email protected]> Cc: Hannes Reinecke <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: David Disseldorp <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
1 parent e3b88ee commit 51ec502

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/target/target_core_tmr.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,8 @@ static void core_tmr_drain_tmr_list(
215215
* LUN_RESET tmr..
216216
*/
217217
spin_lock_irqsave(&dev->se_tmr_lock, flags);
218+
list_del_init(&tmr->tmr_list);
218219
list_for_each_entry_safe(tmr_p, tmr_pp, &dev->dev_tmr_list, tmr_list) {
219-
/*
220-
* Allow the received TMR to return with FUNCTION_COMPLETE.
221-
*/
222-
if (tmr_p == tmr)
223-
continue;
224-
225220
cmd = tmr_p->task_cmd;
226221
if (!cmd) {
227222
pr_err("Unable to locate struct se_cmd for TMR\n");

0 commit comments

Comments
 (0)