]> git.baikalelectronics.ru Git - kernel.git/commit
target: Re-instate sess_wait_list for target_wait_for_sess_cmds
authorNicholas Bellinger <nab@linux-iscsi.org>
Wed, 15 May 2013 07:52:44 +0000 (00:52 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 30 May 2013 04:30:33 +0000 (21:30 -0700)
commit7b3e2ff09cb2bd2f5424723b191924328e8d9769
tree07baf7e2854dcd8f08066e7285ee68a89a4b9ff8
parent121ceadf3d9107457cdbbad99dd3fae37ffa360f
target: Re-instate sess_wait_list for target_wait_for_sess_cmds

Switch back to pre commit 5f98de1a289 list splicing logic for active I/O
shutdown with tcm_qla2xxx + ib_srpt fabrics.

The original commit was done under the incorrect assumption that it's safe to
walk se_sess->sess_cmd_list unprotected in target_wait_for_sess_cmds() after
sess->sess_tearing_down = 1 has been set by target_sess_cmd_list_set_waiting()
during session shutdown.

So instead of adding sess->sess_cmd_lock protection around sess->sess_cmd_list
during target_wait_for_sess_cmds(), switch back to sess->sess_wait_list to
allow wait_for_completion() + TFO->release_cmd() to occur without having to
walk ->sess_cmd_list after the list_splice.

Also add a check to exit if target_sess_cmd_list_set_waiting() has already
been called, and add a WARN_ON to check for any fabric bug where new se_cmds
are added to sess->sess_cmd_list after sess->sess_tearing_down = 1 has already
been set.

Cc: Joern Engel <joern@logfs.org>
Cc: Roland Dreier <roland@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c
include/target/target_core_base.h