]> git.baikalelectronics.ru Git - kernel.git/commit
target: fix list walking in transport_free_dev_tasks
authorChristoph Hellwig <hch@infradead.org>
Mon, 17 Oct 2011 17:56:45 +0000 (13:56 -0400)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 24 Oct 2011 03:21:39 +0000 (03:21 +0000)
commit17a57c6a4c516c27e1263ad181000e302830e88a
treefae9d86d8415ea163a49df6bf290aaef8901702e
parentc8f87db77f7ab4112ecd294f1770b29a6b7e1c54
target: fix list walking in transport_free_dev_tasks

list_for_each_entry_safe only protects against deletions from the list,
but not against any concurrent modifications.  Given that we drop
t_state_lock inside the loop it is not safe in transport_free_dev_tasks.

Instead of use a local dispose_list that we move all tasks that are
to be deleted to.  This is safe because we never do list_emptry checks
on t_list to check if a command is on the list anywhere.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c