From 1faebcc015a8ffca1180edf923ab3572fe64bf3e Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Thu, 21 Nov 2024 15:10:07 +0800 Subject: [PATCH] Squash to "bpf: Add mptcp_subflow bpf_iter" Address Martin's comments in v1: - bpf_iter_mptcp_subflow_new returns -EINVAL when msk socket lock isn't held. Signed-off-by: Geliang Tang --- net/mptcp/bpf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c index 02038db59956c8..5aaeaf641f7fde 100644 --- a/net/mptcp/bpf.c +++ b/net/mptcp/bpf.c @@ -252,7 +252,8 @@ bpf_iter_mptcp_subflow_new(struct bpf_iter_mptcp_subflow *it, if (!msk) return -EINVAL; - msk_owned_by_me(msk); + if (!lockdep_sock_is_held((const struct sock *)msk)) + return -EINVAL; kit->pos = &msk->conn_list; return 0;