FAILED: patch "[PATCH] mptcp: move __mptcp_error_report in protocol.c" failed to apply to 5.15-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x d5fbeff1ab812b6c473b6924bee8748469462e2c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023100421-divisible-bacterium-18b5@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From d5fbeff1ab812b6c473b6924bee8748469462e2c Mon Sep 17 00:00:00 2001
From: Paolo Abeni <[email protected]>
Date: Sat, 16 Sep 2023 12:52:46 +0200
Subject: [PATCH] mptcp: move __mptcp_error_report in protocol.c
This will simplify the next patch ("mptcp: process pending subflow error on close").
No functional change intended.
net/mptcp/protocol.c +36 -0
@@ -770,6 +770,42 @@ static bool __mptcp_ofo_queue(struct mptcp_sock *msk)return moved; } +void __mptcp_error_report (struct sock *sk) +{ +struct mptcp_subflow_context *subflow; +struct mptcp_sock *msk =mptcp_sk (sk); + +mptcp_for_each_subflow (msk, subflow) { +struct sock *ssk =mptcp_subflow_tcp_sock (subflow); +int err =sock_error (ssk); +int ssk_state; + +if (!err) +continue ; + +/* only propagate errors on fallen-back sockets or +* on MPC connect +*/ +if (sk->sk_state !=TCP_SYN_SENT && !__mptcp_check_fallback (msk)) +continue ; + +/* We need to propagate only transition to CLOSE state. +* Orphaned socket will see such state change via +* subflow_sched_work_if_closed() and that path will properly +* destroy the msk as needed. +*/ + ssk_state =inet_sk_state_load (ssk); +if (ssk_state ==TCP_CLOSE && !sock_flag (sk,SOCK_DEAD )) +inet_sk_state_store (sk, ssk_state); +WRITE_ONCE (sk->sk_err, -err); + +/* This barrier is coupled with smp_rmb() in mptcp_poll() */ +smp_wmb (); +sk_error_report (sk); +break ; + } +} +/* In most cases we will be able to lock the mptcp socket. If its already * owned, we need to defer to the work queue to avoid ABBA deadlock. */
net/mptcp/subflow.c +0 -36
@@ -1362,42 +1362,6 @@ void mptcp_space(const struct sock *ssk, int *space, int *full_space) *full_space =mptcp_win_from_space (sk,READ_ONCE (sk->sk_rcvbuf)); } -void __mptcp_error_report (struct sock *sk) -{ -struct mptcp_subflow_context *subflow; -struct mptcp_sock *msk =mptcp_sk (sk); - -mptcp_for_each_subflow (msk, subflow) { -struct sock *ssk =mptcp_subflow_tcp_sock (subflow); -int err =sock_error (ssk); -int ssk_state; - -if (!err) -continue ; - -/* only propagate errors on fallen-back sockets or -* on MPC connect -*/ -if (sk->sk_state !=TCP_SYN_SENT && !__mptcp_check_fallback (msk)) -continue ; - -/* We need to propagate only transition to CLOSE state. -* Orphaned socket will see such state change via -* subflow_sched_work_if_closed() and that path will properly -* destroy the msk as needed. -*/ - ssk_state =inet_sk_state_load (ssk); -if (ssk_state ==TCP_CLOSE && !sock_flag (sk,SOCK_DEAD )) -inet_sk_state_store (sk, ssk_state); -WRITE_ONCE (sk->sk_err, -err); - -/* This barrier is coupled with smp_rmb() in mptcp_poll() */ -smp_wmb (); -sk_error_report (sk); -break ; - } -} -static void subflow_error_report (struct sock *ssk) {struct sock *sk =mptcp_subflow_ctx (ssk)->conn;
Matthieu Baerts (NGI0)
maintainerPATCH 1/1 mptcp: move __mptcp_error_report in protocol.c
From: Paolo Abeni <[email protected]>
This will simplify the next patch ("mptcp: process pending subflow error on close").
No functional change intended.
---
Notes:
- A simple conflict because in v5.15, we don't have 9ae8e5ad99b8 ("mptcp: annotate lockless accesses to sk->sk_err"), and one line from __mptcp_error_report() is different.
- Note that the version of __mptcp_error_report() from after 9ae8e5ad99b8 ("mptcp: annotate lockless accesses to sk->sk_err") has been taken -- with the WRITE_ONCE(sk->sk_err, -err); -- to ease the future backports.
--- net/mptcp/protocol.c | 36 ++++++++++++++++++++++++++++++++++++ net/mptcp/subflow.c | 36 ------------------------------------ 2 files changed, 36 insertions(+), 36 deletions(-)
net/mptcp/protocol.c +36 -0
@@ -688,6 +688,42 @@ static bool __mptcp_ofo_queue(struct mptcp_sock *msk)return moved; } +void __mptcp_error_report (struct sock *sk) +{ +struct mptcp_subflow_context *subflow; +struct mptcp_sock *msk =mptcp_sk (sk); + +mptcp_for_each_subflow (msk, subflow) { +struct sock *ssk =mptcp_subflow_tcp_sock (subflow); +int err =sock_error (ssk); +int ssk_state; + +if (!err) +continue ; + +/* only propagate errors on fallen-back sockets or +* on MPC connect +*/ +if (sk->sk_state !=TCP_SYN_SENT && !__mptcp_check_fallback (msk)) +continue ; + +/* We need to propagate only transition to CLOSE state. +* Orphaned socket will see such state change via +* subflow_sched_work_if_closed() and that path will properly +* destroy the msk as needed. +*/ + ssk_state =inet_sk_state_load (ssk); +if (ssk_state ==TCP_CLOSE && !sock_flag (sk,SOCK_DEAD )) +inet_sk_state_store (sk, ssk_state); +WRITE_ONCE (sk->sk_err, -err); + +/* This barrier is coupled with smp_rmb() in mptcp_poll() */ +smp_wmb (); +sk_error_report (sk); +break ; + } +} +/* In most cases we will be able to lock the mptcp socket. If its already * owned, we need to defer to the work queue to avoid ABBA deadlock. */
net/mptcp/subflow.c +0 -36
@@ -1269,42 +1269,6 @@ void mptcp_space(const struct sock *ssk, int *space, int *full_space) *full_space =tcp_full_space (sk); } -void __mptcp_error_report (struct sock *sk) -{ -struct mptcp_subflow_context *subflow; -struct mptcp_sock *msk =mptcp_sk (sk); - -mptcp_for_each_subflow (msk, subflow) { -struct sock *ssk =mptcp_subflow_tcp_sock (subflow); -int err =sock_error (ssk); -int ssk_state; - -if (!err) -continue ; - -/* only propagate errors on fallen-back sockets or -* on MPC connect -*/ -if (sk->sk_state !=TCP_SYN_SENT && !__mptcp_check_fallback (msk)) -continue ; - -/* We need to propagate only transition to CLOSE state. -* Orphaned socket will see such state change via -* subflow_sched_work_if_closed() and that path will properly -* destroy the msk as needed. -*/ - ssk_state =inet_sk_state_load (ssk); -if (ssk_state ==TCP_CLOSE && !sock_flag (sk,SOCK_DEAD )) -inet_sk_state_store (sk, ssk_state); - sk->sk_err = -err; - -/* This barrier is coupled with smp_rmb() in mptcp_poll() */ -smp_wmb (); -sk_error_report (sk); -break ; - } -} -static void subflow_error_report (struct sock *ssk) {struct sock *sk =mptcp_subflow_ctx (ssk)->conn;
Signature · 1 line
2.43.0
Patch "mptcp: move __mptcp_error_report in protocol.c" has been added to the 5.15-stable tree
This is a note to let you know that I've just added the patch titled
mptcp: move __mptcp_error_report in protocol.c
to the 5.15-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mptcp-move-__mptcp_error_report-in-protocol.c.patch
and it can be found in the queue-5.15 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From [email protected] Wed Feb 28 18:32:33 2024
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Wed, 28 Feb 2024 18:31:58 +0100
Subject: mptcp: move __mptcp_error_report in protocol.c
To: [email protected], [email protected]
Cc: MPTCP Upstream <[email protected]>, Paolo Abeni <[email protected]>, Mat Martineau <[email protected]>, Matthieu Baerts <[email protected]>, "David S . Miller" <[email protected]>, Matthieu Baerts <[email protected]>
Message-ID: <[email protected]>
From: Paolo Abeni <[email protected]>
commit d5fbeff1ab812b6c473b6924bee8748469462e2c upstream.
This will simplify the next patch ("mptcp: process pending subflow error on close").
No functional change intended.
--- net/mptcp/protocol.c | 36 ++++++++++++++++++++++++++++++++++++ net/mptcp/subflow.c | 36 ------------------------------------ 2 files changed, 36 insertions(+), 36 deletions(-)
net/mptcp/protocol.c +36 -0
@@ -688,6 +688,42 @@ static bool __mptcp_ofo_queue(struct mptreturn moved; } +void __mptcp_error_report (struct sock *sk) +{ +struct mptcp_subflow_context *subflow; +struct mptcp_sock *msk =mptcp_sk (sk); + +mptcp_for_each_subflow (msk, subflow) { +struct sock *ssk =mptcp_subflow_tcp_sock (subflow); +int err =sock_error (ssk); +int ssk_state; + +if (!err) +continue ; + +/* only propagate errors on fallen-back sockets or +* on MPC connect +*/ +if (sk->sk_state !=TCP_SYN_SENT && !__mptcp_check_fallback (msk)) +continue ; + +/* We need to propagate only transition to CLOSE state. +* Orphaned socket will see such state change via +* subflow_sched_work_if_closed() and that path will properly +* destroy the msk as needed. +*/ + ssk_state =inet_sk_state_load (ssk); +if (ssk_state ==TCP_CLOSE && !sock_flag (sk,SOCK_DEAD )) +inet_sk_state_store (sk, ssk_state); +WRITE_ONCE (sk->sk_err, -err); + +/* This barrier is coupled with smp_rmb() in mptcp_poll() */ +smp_wmb (); +sk_error_report (sk); +break ; + } +} +/* In most cases we will be able to lock the mptcp socket. If its already * owned, we need to defer to the work queue to avoid ABBA deadlock. */
net/mptcp/subflow.c +0 -36
@@ -1269,42 +1269,6 @@ void mptcp_space(const struct sock *ssk, *full_space =tcp_full_space (sk); } -void __mptcp_error_report (struct sock *sk) -{ -struct mptcp_subflow_context *subflow; -struct mptcp_sock *msk =mptcp_sk (sk); - -mptcp_for_each_subflow (msk, subflow) { -struct sock *ssk =mptcp_subflow_tcp_sock (subflow); -int err =sock_error (ssk); -int ssk_state; - -if (!err) -continue ; - -/* only propagate errors on fallen-back sockets or -* on MPC connect -*/ -if (sk->sk_state !=TCP_SYN_SENT && !__mptcp_check_fallback (msk)) -continue ; - -/* We need to propagate only transition to CLOSE state. -* Orphaned socket will see such state change via -* subflow_sched_work_if_closed() and that path will properly -* destroy the msk as needed. -*/ - ssk_state =inet_sk_state_load (ssk); -if (ssk_state ==TCP_CLOSE && !sock_flag (sk,SOCK_DEAD )) -inet_sk_state_store (sk, ssk_state); - sk->sk_err = -err; - -/* This barrier is coupled with smp_rmb() in mptcp_poll() */ -smp_wmb (); -sk_error_report (sk); -break ; - } -} -static void subflow_error_report (struct sock *ssk) {struct sock *sk =mptcp_subflow_ctx (ssk)->conn;
Patches currently in stable-queue which might be from [email protected] are
queue-5.15/selftests-mptcp-add-missing-kconfig-for-nf-filter.patch queue-5.15/selftests-mptcp-add-missing-kconfig-for-nf-filter-in-v6.patch queue-5.15/mptcp-add-needs_id-for-netlink-appending-addr.patch queue-5.15/mptcp-rename-timer-related-helper-to-less-confusing-names.patch queue-5.15/mptcp-process-pending-subflow-error-on-close.patch queue-5.15/mptcp-clean-up-harmless-false-expressions.patch queue-5.15/mptcp-move-__mptcp_error_report-in-protocol.c.patch
Greg KH
maintainerRe: [PATCH 5.15.y] mptcp: move __mptcp_error_report in protocol.c
In reply to Matthieu Baerts (NGI0)Quoted 14 lines · On Wed, Feb 28, 2024 at 06:31:58PM +0100, Matthieu Baerts (NGI0) wrote:
From: Paolo Abeni <[email protected]>
This will simplify the next patch ("mptcp: process pending subflow error on close").
No functional change intended.
Cc [email protected] # v5.12+Signed-off-by Paolo Abeni <[email protected]>Reviewed-by Mat Martineau <[email protected]>Signed-off-by Matthieu Baerts <[email protected]>Signed-off-by David S. Miller <[email protected]>(cherry picked from commit d5fbeff1ab812b6c473b6924bee8748469462e2c)Signed-off-by Matthieu Baerts (NGI0) <[email protected]>
Quoted 9 lines
---
Notes:
- A simple conflict because in v5.15, we don't have9ae8e5ad99b8("mptcp: annotate lockless accesses tosk->sk_err"), and one line from__mptcp_error_report()is different.
- Note that the version of__mptcp_error_report()from after9ae8e5ad99b8("mptcp: annotate lockless accesses tosk->sk_err") has been taken -- with theWRITE_ONCE(sk->sk_err, -err); -- to ease the future backports.
All 5.15 backports now queued up, thanks!
greg k-h