diff mbox series

[mptcp-next,v1,2/3] Squash to "mptcp: pm: add established() interface"

Message ID 2979f2af3a16e17153a22a2ee6b6dd254a75bd3b.1742181977.git.tanggeliang@kylinos.cn (mailing list archive)
State Superseded, archived
Headers show
Series bugfixes for "BPF path manager, part 6, v2" | expand

Checks

Context Check Description
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 18 lines checked
matttbe/shellcheck success MPTCP selftests files have not been modified
matttbe/build success Build and static analysis OK
matttbe/KVM_Validation__normal success Success! ✅
matttbe/KVM_Validation__debug fail Critical: Global Timeout ❌
matttbe/KVM_Validation__btf-normal__only_bpftest_all_ success Success! ✅
matttbe/KVM_Validation__btf-debug__only_bpftest_all_ success Success! ✅

Commit Message

Geliang Tang March 17, 2025, 3:29 a.m. UTC
From: Geliang Tang <tanggeliang@kylinos.cn>

Same as .subflow_established, .established can't be invoked under mptcp
pm lock too.

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/pm.c        | 2 ++
 net/mptcp/pm_kernel.c | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 38abf15718b9..788fbe31a40f 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -938,7 +938,9 @@  void mptcp_pm_worker(struct mptcp_sock *msk)
 	}
 	if (pm->status & BIT(MPTCP_PM_ESTABLISHED)) {
 		pm->status &= ~BIT(MPTCP_PM_ESTABLISHED);
+		spin_unlock_bh(&msk->pm.lock);
 		pm->ops->established(msk);
+		spin_lock_bh(&msk->pm.lock);
 	}
 	if (pm->status & BIT(MPTCP_PM_SUBFLOW_ESTABLISHED)) {
 		pm->status &= ~BIT(MPTCP_PM_SUBFLOW_ESTABLISHED);
diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
index 0c78715ed87f..f8cac996694c 100644
--- a/net/mptcp/pm_kernel.c
+++ b/net/mptcp/pm_kernel.c
@@ -369,7 +369,9 @@  static void mptcp_pm_create_subflow_or_signal_addr(struct mptcp_sock *msk)
 
 static void mptcp_pm_kernel_established(struct mptcp_sock *msk)
 {
+	spin_lock_bh(&msk->pm.lock);
 	mptcp_pm_create_subflow_or_signal_addr(msk);
+	spin_unlock_bh(&msk->pm.lock);
 }
 
 static void mptcp_pm_kernel_subflow_established(struct mptcp_sock *msk)