diff mbox series

[4/4] poll: release lock before waiting

Message ID 20191105170531.30407-5-fw@strlen.de
State Accepted, archived
Delegated to: Matthieu Baerts
Headers show
Series [1/4] protocol.h: mptcp_subflow_get_map_offset arg can be const | expand

Commit Message

Florian Westphal Nov. 5, 2019, 5:05 p.m. UTC
else, this can block kworker thread forever -- it needs to lock the
mptcp socket, so we should not hold this lock when waiting for events.

squashto: mptcp: add mptcp_poll

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 net/mptcp/protocol.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 8cc9cc5675c2..53b1b015d9d4 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1229,7 +1229,9 @@  static __poll_t mptcp_poll(struct file *file, struct socket *sock,
 		return ret;
 	}
 
+	release_sock(sk);
 	sock_poll_wait(file, sock, wait);
+	lock_sock(sk);
 
 	mptcp_for_each_subflow(msk, subflow) {
 		struct socket *tcp_sock;