diff options
author | Jakub Kicinski <kuba@kernel.org> | 2023-02-09 21:05:25 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-02-09 21:25:40 +0100 |
commit | 8697a258ae24703267d2a37d91ab757c91ef027e (patch) | |
tree | 7a1798898ac64c72e6cf77d2320f036c963a16c1 /net/mptcp/protocol.c | |
parent | net: enable usercopy for skb_small_head_cache (diff) | |
parent | Merge tag 'net-6.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netd... (diff) | |
download | linux-8697a258ae24703267d2a37d91ab757c91ef027e.tar.xz linux-8697a258ae24703267d2a37d91ab757c91ef027e.zip |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
net/devlink/leftover.c / net/core/devlink.c:
565b4824c39f ("devlink: change port event netdev notifier from per-net to global")
f05bd8ebeb69 ("devlink: move code to a dedicated directory")
687125b5799c ("devlink: split out core code")
https://lore.kernel.org/all/20230208094657.379f2b1a@canb.auug.org.au/
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/mptcp/protocol.c')
-rw-r--r-- | net/mptcp/protocol.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 1ff2efbab29e..c9817aa0f413 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2902,6 +2902,7 @@ bool __mptcp_close(struct sock *sk, long timeout) struct mptcp_subflow_context *subflow; struct mptcp_sock *msk = mptcp_sk(sk); bool do_cancel_work = false; + int subflows_alive = 0; sk->sk_shutdown = SHUTDOWN_MASK; @@ -2928,6 +2929,8 @@ cleanup: struct sock *ssk = mptcp_subflow_tcp_sock(subflow); bool slow = lock_sock_fast_nested(ssk); + subflows_alive += ssk->sk_state != TCP_CLOSE; + /* since the close timeout takes precedence on the fail one, * cancel the latter */ @@ -2943,6 +2946,12 @@ cleanup: } sock_orphan(sk); + /* all the subflows are closed, only timeout can change the msk + * state, let's not keep resources busy for no reasons + */ + if (subflows_alive == 0) + inet_sk_state_store(sk, TCP_CLOSE); + sock_hold(sk); pr_debug("msk=%p state=%d", sk, sk->sk_state); if (msk->token) |