Message ID | 9c3c3b39b1f5c0eb3f1788ca84267ad838c0c59a.1603205529.git.pabeni@redhat.com |
---|---|
State | Accepted, archived |
Commit | c64a74456ff933c4559faaf1e789b0b3159ca1ff |
Delegated to: | Matthieu Baerts |
Headers | show |
Series | [net-next] Squash-to: "mptcp: introduce mptcp_schedule_work" | expand |
Hi Paolo, On 20/10/2020 16:52, Paolo Abeni wrote: > Let's add some comment to clarify the reference management, > as it already raised a few questions upstream Thank you for the patch! - c64a74456ff9: "squashed" in "mptcp: introduce mptcp_schedule_work" - 0fd2f58f6a86: mptcp: fix typo in comment (duplicated "and") - Results: c0690c525b32..da50c705808b Cheers, Matt
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 0bff3aa08270..a32c27fe525c 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -731,6 +731,10 @@ bool mptcp_schedule_work(struct sock *sk) { if (inet_sk_state_load(sk) != TCP_CLOSE && schedule_work(&mptcp_sk(sk)->work)) { + /* each subflow already holds a reference to the sk, and + * and the workqueue is invoked by a subflow, so sk can't + * go away here. + */ sock_hold(sk); return true; }
Let's add some comment to clarify the reference management, as it already raised a few questions upstream Signed-off-by: Paolo Abeni <pabeni@redhat.com> --- net/mptcp/protocol.c | 4 ++++ 1 file changed, 4 insertions(+)