diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index a83885c5bb86cbb2b86d80cf512d2c15ec1c1922..dda4e951aebaac77d7bf09e09a63dfeeb905a7a9 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -393,7 +393,7 @@ static inline void sk_psock_report_error(struct sk_psock *psock, int err) } struct sk_psock *sk_psock_init(struct sock *sk, int node); -void sk_psock_stop(struct sk_psock *psock, bool wait); +void sk_psock_stop(struct sk_psock *psock); int sk_psock_init_strp(struct sock *sk, struct sk_psock *psock); void sk_psock_start_strp(struct sock *sk, struct sk_psock *psock); diff --git a/net/core/skmsg.c b/net/core/skmsg.c index 26a39b672966860519c5f5c98c56b57d965834c5..78cb3782326dc7e20057ec124abe0a79dce330d2 100644 --- a/net/core/skmsg.c +++ b/net/core/skmsg.c @@ -695,16 +695,13 @@ static void sk_psock_link_destroy(struct sk_psock *psock) } } -void sk_psock_stop(struct sk_psock *psock, bool wait) +void sk_psock_stop(struct sk_psock *psock) { spin_lock_bh(&psock->ingress_lock); sk_psock_clear_state(psock, SK_PSOCK_TX_ENABLED); sk_psock_cork_free(psock); __sk_psock_zap_ingress(psock); spin_unlock_bh(&psock->ingress_lock); - - if (wait) - cancel_work_sync(&psock->work); } static void sk_psock_destroy_deferred(struct work_struct *gc) @@ -750,7 +747,7 @@ void sk_psock_drop(struct sock *sk, struct sk_psock *psock) sk_psock_stop_verdict(sk, psock); write_unlock_bh(&sk->sk_callback_lock); - sk_psock_stop(psock, false); + sk_psock_stop(psock); call_rcu(&psock->rcu, sk_psock_destroy); } EXPORT_SYMBOL_GPL(sk_psock_drop); diff --git a/net/core/sock_map.c b/net/core/sock_map.c index 46a73cbf0729adc43589b2b29e8312e710791384..0e00e9a0d22d2a91410069a80fa6624653abd57e 100644 --- a/net/core/sock_map.c +++ b/net/core/sock_map.c @@ -1651,7 +1651,7 @@ void sock_map_destroy(struct sock *sk) saved_destroy = psock->saved_destroy; sock_map_remove_links(sk, psock); rcu_read_unlock(); - sk_psock_stop(psock, false); + sk_psock_stop(psock); sk_psock_put(sk, psock); saved_destroy(sk); } @@ -1674,9 +1674,10 @@ void sock_map_close(struct sock *sk, long timeout) saved_close = psock->saved_close; sock_map_remove_links(sk, psock); rcu_read_unlock(); - sk_psock_stop(psock, true); - sk_psock_put(sk, psock); + sk_psock_stop(psock); release_sock(sk); + cancel_work_sync(&psock->work); + sk_psock_put(sk, psock); saved_close(sk, timeout); }