mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
Target/iser: Bail from accept_np if np_thread is trying to close
commit e346ab343f upstream.
In case np_thread state is in RESET/SHUTDOWN/EXIT states,
no point for isert to stall there as we may get a hang in
case no one will wake it up later.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8d26d1a24b
commit
3ddb875488
@@ -2190,9 +2190,14 @@ accept_wait:
|
||||
return -ENODEV;
|
||||
|
||||
spin_lock_bh(&np->np_thread_lock);
|
||||
if (np->np_thread_state == ISCSI_NP_THREAD_RESET) {
|
||||
if (np->np_thread_state >= ISCSI_NP_THREAD_RESET) {
|
||||
spin_unlock_bh(&np->np_thread_lock);
|
||||
pr_debug("ISCSI_NP_THREAD_RESET for isert_accept_np\n");
|
||||
pr_debug("np_thread_state %d for isert_accept_np\n",
|
||||
np->np_thread_state);
|
||||
/**
|
||||
* No point in stalling here when np_thread
|
||||
* is in state RESET/SHUTDOWN/EXIT - bail
|
||||
**/
|
||||
return -ENODEV;
|
||||
}
|
||||
spin_unlock_bh(&np->np_thread_lock);
|
||||
|
||||
Reference in New Issue
Block a user