]> git.baikalelectronics.ru Git - kernel.git/commit
target: fix potential race window in target_sess_cmd_list_waiting()
authorHannes Reinecke <hare@suse.de>
Mon, 22 Aug 2016 08:54:07 +0000 (10:54 +0200)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 21 Oct 2016 08:19:41 +0000 (01:19 -0700)
commit6dd7fd2e74e0677200a14168a900a8545f9cbe64
tree205b14587942953e85ff09798ac87d7ce1497f30
parent09c0eecbd270cf9fad7c9e615ea3cd6f7f5850e8
target: fix potential race window in target_sess_cmd_list_waiting()

target_sess_cmd_list_waiting() might hit on a condition where
the kref for the command is already 0, but the destructor has
not been called yet (or is stuck in waiting for a spin lock).
Rather than leaving the command on the list we should explicitly
remove it to avoid race issues later on.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c