Commit 0cf56a1a authored by Bruno Faccini's avatar Bruno Faccini Committed by Greg Kroah-Hartman

staging: lustre: avoid race during lnet acceptor thread termination

This patch will avoid potential race, around socket sleepers
wait list, during acceptor thread termination and using
sk_callback_lock RW-Lock protection.
Signed-off-by: default avatarBruno Faccini <bruno.faccini@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6476
Reviewed-on: http://review.whamcloud.com/14503Reviewed-by: default avatarAmir Shehata <amir.shehata@intel.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 349183aa
...@@ -488,11 +488,17 @@ lnet_acceptor_start(void) ...@@ -488,11 +488,17 @@ lnet_acceptor_start(void)
void void
lnet_acceptor_stop(void) lnet_acceptor_stop(void)
{ {
struct sock *sk;
if (lnet_acceptor_state.pta_shutdown) /* not running */ if (lnet_acceptor_state.pta_shutdown) /* not running */
return; return;
lnet_acceptor_state.pta_shutdown = 1; lnet_acceptor_state.pta_shutdown = 1;
wake_up_all(sk_sleep(lnet_acceptor_state.pta_sock->sk));
sk = lnet_acceptor_state.pta_sock->sk;
/* awake any sleepers using safe method */
sk->sk_state_change(sk);
/* block until acceptor signals exit */ /* block until acceptor signals exit */
wait_for_completion(&lnet_acceptor_state.pta_signal); wait_for_completion(&lnet_acceptor_state.pta_signal);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment