Callers must now explicitly shutdown the thread via iscsit_shutdown_np_thread() prior to deletion. Signed-off-by: David Disseldorp <ddiss@xxxxxxx> --- drivers/target/iscsi/iscsi_target.c | 17 +++++------------ drivers/target/iscsi/iscsi_target_tpg.c | 3 --- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index e730249..e3ae33d 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c @@ -535,20 +535,13 @@ int iscsit_del_np(struct iscsi_np *np) spin_unlock_bh(&np->np_thread_lock); return 0; } - np->np_thread_state = ISCSI_NP_THREAD_SHUTDOWN; - spin_unlock_bh(&np->np_thread_lock); - if (np->np_thread) { - /* - * We need to send the signal to wakeup Linux/Net - * which may be sleeping in sock_accept().. - */ - send_sig(SIGINT, np->np_thread, 1); - kthread_stop(np->np_thread); - np->np_thread = NULL; + if (np->np_thread_state == ISCSI_NP_THREAD_ACTIVE) { + pr_err("invalid thread state for np deletion\n"); + spin_unlock_bh(&np->np_thread_lock); + return 0; } - - np->np_transport->iscsit_free_np(np); + spin_unlock_bh(&np->np_thread_lock); mutex_lock(&np_lock); list_del(&np->np_list); diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index f8f83c3..ec9eb78 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c @@ -627,9 +627,6 @@ static int iscsit_tpg_release_np( tpg_np->tpg_np = NULL; tpg_np->tpg = NULL; kfree(tpg_np); - /* - * iscsit_del_np() will shutdown struct iscsi_np when last TPG reference is released. - */ return iscsit_del_np(np); } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html