From: Sagi Grimberg Date: Mon, 19 May 2014 14:44:22 +0000 (+0300) Subject: Target/iser: Bail from accept_np if np_thread is trying to close X-Git-Tag: upstream/snapshot3+hdmi~2324 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3e41b2b57122819ee833ae377ff125dd13d973a2;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git Target/iser: Bail from accept_np if np_thread is trying to close commit e346ab343f4f58c12a96725c7b13df9cc2ad56f6 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 Signed-off-by: Nicholas Bellinger Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 0911691..cbdf662 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c @@ -2725,9 +2725,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);