The patch below does not apply to the 6.1-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 <stable(a)vger.kernel.org>.
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-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x f2655ac2c06a15558e51ed6529de280e1553c86e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2024081131-chewable-convent-91a9@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
f2655ac2c06a ("clocksource: Fix brown-bag boolean thinko in cs_watchdog_read()")
2ed08e4bc532 ("clocksource: Scale the watchdog read retries automatically")
877a0e83c57f ("torture: Enable clocksource watchdog with "tsc=watchdog"")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f2655ac2c06a15558e51ed6529de280e1553c86e Mon Sep 17 00:00:00 2001
From: "Paul E. McKenney" <paulmck(a)kernel.org>
Date: Fri, 2 Aug 2024 08:46:15 -0700
Subject: [PATCH] clocksource: Fix brown-bag boolean thinko in
cs_watchdog_read()
The current "nretries > 1 || nretries >= max_retries" check in
cs_watchdog_read() will always evaluate to true, and thus pr_warn(), if
nretries is greater than 1. The intent is instead to never warn on the
first try, but otherwise warn if the successful retry was the last retry.
Therefore, change that "||" to "&&".
Fixes: db3a34e17433 ("clocksource: Retry clock read if long delays detected")
Reported-by: Borislav Petkov <bp(a)alien8.de>
Signed-off-by: Paul E. McKenney <paulmck(a)kernel.org>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: stable(a)vger.kernel.org
Link: https://lore.kernel.org/all/20240802154618.4149953-2-paulmck@kernel.org
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index d25ba49e313c..d0538a75f4c6 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -246,7 +246,7 @@ static enum wd_read_status cs_watchdog_read(struct clocksource *cs, u64 *csnow,
wd_delay = cycles_to_nsec_safe(watchdog, *wdnow, wd_end);
if (wd_delay <= WATCHDOG_MAX_SKEW) {
- if (nretries > 1 || nretries >= max_retries) {
+ if (nretries > 1 && nretries >= max_retries) {
pr_warn("timekeeping watchdog on CPU%d: %s retried %d times before success\n",
smp_processor_id(), watchdog->name, nretries);
}
The patch below does not apply to the 6.6-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 <stable(a)vger.kernel.org>.
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-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x f2655ac2c06a15558e51ed6529de280e1553c86e
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable(a)vger.kernel.org>' --in-reply-to '2024081130-crucial-lurch-a32a@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..
Possible dependencies:
f2655ac2c06a ("clocksource: Fix brown-bag boolean thinko in cs_watchdog_read()")
2ed08e4bc532 ("clocksource: Scale the watchdog read retries automatically")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From f2655ac2c06a15558e51ed6529de280e1553c86e Mon Sep 17 00:00:00 2001
From: "Paul E. McKenney" <paulmck(a)kernel.org>
Date: Fri, 2 Aug 2024 08:46:15 -0700
Subject: [PATCH] clocksource: Fix brown-bag boolean thinko in
cs_watchdog_read()
The current "nretries > 1 || nretries >= max_retries" check in
cs_watchdog_read() will always evaluate to true, and thus pr_warn(), if
nretries is greater than 1. The intent is instead to never warn on the
first try, but otherwise warn if the successful retry was the last retry.
Therefore, change that "||" to "&&".
Fixes: db3a34e17433 ("clocksource: Retry clock read if long delays detected")
Reported-by: Borislav Petkov <bp(a)alien8.de>
Signed-off-by: Paul E. McKenney <paulmck(a)kernel.org>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: stable(a)vger.kernel.org
Link: https://lore.kernel.org/all/20240802154618.4149953-2-paulmck@kernel.org
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index d25ba49e313c..d0538a75f4c6 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -246,7 +246,7 @@ static enum wd_read_status cs_watchdog_read(struct clocksource *cs, u64 *csnow,
wd_delay = cycles_to_nsec_safe(watchdog, *wdnow, wd_end);
if (wd_delay <= WATCHDOG_MAX_SKEW) {
- if (nretries > 1 || nretries >= max_retries) {
+ if (nretries > 1 && nretries >= max_retries) {
pr_warn("timekeeping watchdog on CPU%d: %s retried %d times before success\n",
smp_processor_id(), watchdog->name, nretries);
}
On Sun, Aug 11, 2024 at 1:59 PM Sasha Levin <sashal(a)kernel.org> wrote:
>
> This is a note to let you know that I've just added the patch titled
>
> btrfs: reduce nesting for extent processing at btrfs_lookup_extent_info()
>
> to the 6.10-stable tree which can be found at:
> http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
>
> The filename of the patch is:
> btrfs-reduce-nesting-for-extent-processing-at-btrfs_.patch
> and it can be found in the queue-6.10 subdirectory.
>
> If you, or anyone else, feels it should not be added to the stable tree,
> please let <stable(a)vger.kernel.org> know about it.
Why is this being added to stable releases?
It's just a cleanup, it doesn't fix any bug or compiler warning, etc.
>
>
>
> commit 5a0873e18421183cf695cc5f2c851aac4e1d832c
> Author: Filipe Manana <fdmanana(a)suse.com>
> Date: Tue Jun 18 11:52:19 2024 +0100
>
> btrfs: reduce nesting for extent processing at btrfs_lookup_extent_info()
>
> [ Upstream commit 5c83b3beaee06aa88d4015408ac2d8bb35380b06 ]
>
> Instead of using an if-else statement when processing the extent item at
> btrfs_lookup_extent_info(), use a single if statement for the error case
> since it does a goto at the end and leave the success (expected) case
> following the if statement, reducing indentation and making the logic a
> bit easier to follow. Also make the if statement's condition as unlikely
> since it's not expected to ever happen, as it signals some corruption,
> making it clear and hint the compiler to generate more efficient code.
>
> Reviewed-by: Qu Wenruo <wqu(a)suse.com>
> Signed-off-by: Filipe Manana <fdmanana(a)suse.com>
> Signed-off-by: David Sterba <dsterba(a)suse.com>
> Signed-off-by: Sasha Levin <sashal(a)kernel.org>
>
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 153297cb97a4a..844b677d054ec 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -104,10 +104,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
> struct btrfs_delayed_ref_head *head;
> struct btrfs_delayed_ref_root *delayed_refs;
> struct btrfs_path *path;
> - struct btrfs_extent_item *ei;
> - struct extent_buffer *leaf;
> struct btrfs_key key;
> - u32 item_size;
> u64 num_refs;
> u64 extent_flags;
> u64 owner = 0;
> @@ -157,16 +154,11 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
> }
>
> if (ret == 0) {
> - leaf = path->nodes[0];
> - item_size = btrfs_item_size(leaf, path->slots[0]);
> - if (item_size >= sizeof(*ei)) {
> - ei = btrfs_item_ptr(leaf, path->slots[0],
> - struct btrfs_extent_item);
> - num_refs = btrfs_extent_refs(leaf, ei);
> - extent_flags = btrfs_extent_flags(leaf, ei);
> - owner = btrfs_get_extent_owner_root(fs_info, leaf,
> - path->slots[0]);
> - } else {
> + struct extent_buffer *leaf = path->nodes[0];
> + struct btrfs_extent_item *ei;
> + const u32 item_size = btrfs_item_size(leaf, path->slots[0]);
> +
> + if (unlikely(item_size < sizeof(*ei))) {
> ret = -EUCLEAN;
> btrfs_err(fs_info,
> "unexpected extent item size, has %u expect >= %zu",
> @@ -179,6 +171,10 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
> goto out_free;
> }
>
> + ei = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item);
> + num_refs = btrfs_extent_refs(leaf, ei);
> + extent_flags = btrfs_extent_flags(leaf, ei);
> + owner = btrfs_get_extent_owner_root(fs_info, leaf, path->slots[0]);
> BUG_ON(num_refs == 0);
> } else {
> num_refs = 0;
bpf tool build fails for the latest stable-rc 6.1.103-rc3
The error details are as follows:
prog.c: In function 'load_with_options':
prog.c:1710:23: warning: implicit declaration of function 'create_and_mount_bpffs_dir' [-Wimplicit-function-declaration]
1710 | err = create_and_mount_bpffs_dir(pinmaps);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
CC struct_ops.o
CC tracelog.o
CC xlated_dumper.o
CC jit_disasm.o
CC disasm.o
LINK bpftool
/usr/bin/ld: prog.o: in function `load_with_options':
prog.c:(.text+0x346a): undefined reference to `create_and_mount_bpffs_dir'
The commit causing this failure in 6.1.103-rc3: bc1605fcb33bf7a300cd3ac5c409a16bda1626ba
It appears that the commit from the 6.10 series is missing in this release candidate:
478a535ae54a ("bpftool: Mount bpffs on provided dir instead of parent dir")
Thanks,
Hardik
From: "Matthieu Baerts (NGI0)" <matttbe(a)kernel.org>
Before this patch, receiving an ADD_ADDR echo on the just connected
MP_JOIN subflow -- initiator side, after the MP_JOIN 3WHS -- was
resulting in an MP_RESET. That's because only ACKs with a DSS or
ADD_ADDRs without the echo bit were allowed.
Not allowing the ADD_ADDR echo after an MP_CAPABLE 3WHS makes sense, as
we are not supposed to send an ADD_ADDR before because it requires to be
in full established mode first. For the MP_JOIN 3WHS, that's different:
the ADD_ADDR can be sent on a previous subflow, and the ADD_ADDR echo
can be received on the recently created one. The other peer will already
be in fully established, so it is allowed to send that.
We can then relax the conditions here to accept the ADD_ADDR echo for
MPJ subflows.
Fixes: 67b12f792d5e ("mptcp: full fully established support after ADD_ADDR")
Cc: stable(a)vger.kernel.org
Reviewed-by: Mat Martineau <martineau(a)kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe(a)kernel.org>
Link: https://patch.msgid.link/20240731-upstream-net-20240731-mptcp-endp-subflow-…
Signed-off-by: Jakub Kicinski <kuba(a)kernel.org>
---
net/mptcp/options.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index 8a68382a4fe9..ac2f1a54cc43 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -958,7 +958,8 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
if (subflow->remote_key_valid &&
(((mp_opt->suboptions & OPTION_MPTCP_DSS) && mp_opt->use_ack) ||
- ((mp_opt->suboptions & OPTION_MPTCP_ADD_ADDR) && !mp_opt->echo))) {
+ ((mp_opt->suboptions & OPTION_MPTCP_ADD_ADDR) &&
+ (!mp_opt->echo || subflow->mp_join)))) {
/* subflows are fully established as soon as we get any
* additional ack, including ADD_ADDR.
*/
--
2.17.1