From 3abc05d9ef6fe989706b679e1e6371d6360d3db4 Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Thu, 4 Feb 2021 15:23:30 -0800 Subject: mptcp: pm: add lockdep assertions Add a few assertions to make sure functions are called with the needed locks held. Two functions gain might_sleep annotations because they contain conditional calls to functions that sleep. Signed-off-by: Florian Westphal Signed-off-by: Mat Martineau Signed-off-by: Jakub Kicinski --- net/mptcp/protocol.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/mptcp/protocol.c') diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 1405e146dd7c..b9f16a1535d2 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2187,6 +2187,8 @@ static void __mptcp_close_subflow(struct mptcp_sock *msk) { struct mptcp_subflow_context *subflow, *tmp; + might_sleep(); + list_for_each_entry_safe(subflow, tmp, &msk->conn_list, node) { struct sock *ssk = mptcp_subflow_tcp_sock(subflow); @@ -2529,6 +2531,8 @@ static void __mptcp_destroy_sock(struct sock *sk) pr_debug("msk=%p", msk); + might_sleep(); + /* dispose the ancillatory tcp socket, if any */ if (msk->subflow) { iput(SOCK_INODE(msk->subflow)); -- cgit v1.2.3