From 6c950820c9c5b748889d66d4eae0c3d2d4668650 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Thu, 28 Jan 2021 06:44:01 +0000 Subject: [PATCH] mptcp: avoid lock_fast usage in accept path Once event support is added this may need to allocate memory while msk lock is held with softirqs disabled. Not using lock_fast also allows to do the allocation with GFP_KERNEL. Reviewed-by: Mat Martineau Signed-off-by: Florian Westphal --- net/mptcp/protocol.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 603163ad987cd..7019e026fecc8 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3256,9 +3256,8 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock, struct mptcp_sock *msk = mptcp_sk(newsock->sk); struct mptcp_subflow_context *subflow; struct sock *newsk = newsock->sk; - bool slowpath; - slowpath = lock_sock_fast(newsk); + lock_sock(newsk); /* PM/worker can now acquire the first subflow socket * lock without racing with listener queue cleanup, @@ -3284,7 +3283,7 @@ static int mptcp_stream_accept(struct socket *sock, struct socket *newsock, if (!ssk->sk_socket) mptcp_sock_graft(ssk, newsock); } - unlock_sock_fast(newsk, slowpath); + release_sock(newsk); } if (inet_csk_listen_poll(ssock->sk))