diff mbox series

[v2,2/3] Squash-to: "net: mptcp: improve fallback to TCP"

Message ID e13417cbebcc883dcec3f9fd0a7c1c86e74db691.1591652866.git.pabeni@redhat.com
State Accepted, archived
Delegated to: Matthieu Baerts
Headers show
Series mptcp: more token follow-up | expand

Commit Message

Paolo Abeni June 8, 2020, 9:51 p.m. UTC
Drop socket lock on mptcp poll: we don't need it anymore,
as we only use atomic ops on msk flags

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 net/mptcp/protocol.c | 3 ---
 net/mptcp/subflow.c  | 5 +++--
 2 files changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 817472998c37..d6e786f20681 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1945,7 +1945,6 @@  static __poll_t mptcp_poll(struct file *file, struct socket *sock,
 
 	msk = mptcp_sk(sk);
 	sock_poll_wait(file, sock, wait);
-	lock_sock(sk);
 
 	if (test_bit(MPTCP_DATA_READY, &msk->flags))
 		mask = EPOLLIN | EPOLLRDNORM;
@@ -1955,8 +1954,6 @@  static __poll_t mptcp_poll(struct file *file, struct socket *sock,
 	if (sk->sk_shutdown & RCV_SHUTDOWN)
 		mask |= EPOLLIN | EPOLLRDNORM | EPOLLRDHUP;
 
-	release_sock(sk);
-
 	return mask;
 }
 
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index cd0f8c14be40..db066a43925f 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -247,10 +247,11 @@  static void subflow_finish_connect(struct sock *sk, const struct sk_buff *skb)
 		pr_debug("subflow=%p, thmac=%llu, remote_nonce=%u", subflow,
 			 subflow->thmac, subflow->remote_nonce);
 	} else  {
+		if (subflow->request_mptcp)
+			MPTCP_INC_STATS(sock_net(sk),
+					MPTCP_MIB_MPCAPABLEACTIVEFALLBACK);
 		mptcp_do_fallback(sk);
 		pr_fallback(mptcp_sk(subflow->conn));
-		MPTCP_INC_STATS(sock_net(sk),
-				MPTCP_MIB_MPCAPABLEACTIVEFALLBACK);
 	}
 
 	if (mptcp_check_fallback(sk))