]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.13-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Apr 2025 10:50:38 +0000 (11:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 1 Apr 2025 10:50:38 +0000 (11:50 +0100)
added patches:
cgroup-rstat-fix-forceidle-time-in-cpu.stat.patch
nfsd-fix-legacy-client-tracking-initialization.patch

queue-6.13/cgroup-rstat-fix-forceidle-time-in-cpu.stat.patch [new file with mode: 0644]
queue-6.13/nfsd-fix-legacy-client-tracking-initialization.patch [new file with mode: 0644]
queue-6.13/series

diff --git a/queue-6.13/cgroup-rstat-fix-forceidle-time-in-cpu.stat.patch b/queue-6.13/cgroup-rstat-fix-forceidle-time-in-cpu.stat.patch
new file mode 100644 (file)
index 0000000..04312ee
--- /dev/null
@@ -0,0 +1,76 @@
+From c4af66a95aa3bc1d4f607ebd4eea524fb58946e3 Mon Sep 17 00:00:00 2001
+From: Abel Wu <wuyun.abel@bytedance.com>
+Date: Sun, 9 Feb 2025 14:13:11 +0800
+Subject: cgroup/rstat: Fix forceidle time in cpu.stat
+
+From: Abel Wu <wuyun.abel@bytedance.com>
+
+commit c4af66a95aa3bc1d4f607ebd4eea524fb58946e3 upstream.
+
+The commit b824766504e4 ("cgroup/rstat: add force idle show helper")
+retrieves forceidle_time outside cgroup_rstat_lock for non-root cgroups
+which can be potentially inconsistent with other stats.
+
+Rather than reverting that commit, fix it in a way that retains the
+effort of cleaning up the ifdef-messes.
+
+Fixes: b824766504e4 ("cgroup/rstat: add force idle show helper")
+Signed-off-by: Abel Wu <wuyun.abel@bytedance.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/cgroup/rstat.c |   29 +++++++++++++----------------
+ 1 file changed, 13 insertions(+), 16 deletions(-)
+
+--- a/kernel/cgroup/rstat.c
++++ b/kernel/cgroup/rstat.c
+@@ -612,36 +612,33 @@ static void cgroup_force_idle_show(struc
+ void cgroup_base_stat_cputime_show(struct seq_file *seq)
+ {
+       struct cgroup *cgrp = seq_css(seq)->cgroup;
+-      u64 usage, utime, stime, ntime;
++      struct cgroup_base_stat bstat;
+       if (cgroup_parent(cgrp)) {
+               cgroup_rstat_flush_hold(cgrp);
+-              usage = cgrp->bstat.cputime.sum_exec_runtime;
++              bstat = cgrp->bstat;
+               cputime_adjust(&cgrp->bstat.cputime, &cgrp->prev_cputime,
+-                             &utime, &stime);
+-              ntime = cgrp->bstat.ntime;
++                             &bstat.cputime.utime, &bstat.cputime.stime);
+               cgroup_rstat_flush_release(cgrp);
+       } else {
+-              /* cgrp->bstat of root is not actually used, reuse it */
+-              root_cgroup_cputime(&cgrp->bstat);
+-              usage = cgrp->bstat.cputime.sum_exec_runtime;
+-              utime = cgrp->bstat.cputime.utime;
+-              stime = cgrp->bstat.cputime.stime;
+-              ntime = cgrp->bstat.ntime;
++              root_cgroup_cputime(&bstat);
+       }
+-      do_div(usage, NSEC_PER_USEC);
+-      do_div(utime, NSEC_PER_USEC);
+-      do_div(stime, NSEC_PER_USEC);
+-      do_div(ntime, NSEC_PER_USEC);
++      do_div(bstat.cputime.sum_exec_runtime, NSEC_PER_USEC);
++      do_div(bstat.cputime.utime, NSEC_PER_USEC);
++      do_div(bstat.cputime.stime, NSEC_PER_USEC);
++      do_div(bstat.ntime, NSEC_PER_USEC);
+       seq_printf(seq, "usage_usec %llu\n"
+                       "user_usec %llu\n"
+                       "system_usec %llu\n"
+                       "nice_usec %llu\n",
+-                      usage, utime, stime, ntime);
++                      bstat.cputime.sum_exec_runtime,
++                      bstat.cputime.utime,
++                      bstat.cputime.stime,
++                      bstat.ntime);
+-      cgroup_force_idle_show(seq, &cgrp->bstat);
++      cgroup_force_idle_show(seq, &bstat);
+ }
+ /* Add bpf kfuncs for cgroup_rstat_updated() and cgroup_rstat_flush() */
diff --git a/queue-6.13/nfsd-fix-legacy-client-tracking-initialization.patch b/queue-6.13/nfsd-fix-legacy-client-tracking-initialization.patch
new file mode 100644 (file)
index 0000000..9e831d4
--- /dev/null
@@ -0,0 +1,37 @@
+From de71d4e211eddb670b285a0ea477a299601ce1ca Mon Sep 17 00:00:00 2001
+From: Scott Mayhew <smayhew@redhat.com>
+Date: Tue, 10 Dec 2024 07:25:54 -0500
+Subject: nfsd: fix legacy client tracking initialization
+
+From: Scott Mayhew <smayhew@redhat.com>
+
+commit de71d4e211eddb670b285a0ea477a299601ce1ca upstream.
+
+Get rid of the nfsd4_legacy_tracking_ops->init() call in
+check_for_legacy_methods().  That will be handled in the caller
+(nfsd4_client_tracking_init()).  Otherwise, we'll wind up calling
+nfsd4_legacy_tracking_ops->init() twice, and the second time we'll
+trigger the BUG_ON() in nfsd4_init_recdir().
+
+Fixes: 74fd48739d04 ("nfsd: new Kconfig option for legacy client tracking")
+Reported-by: Jur van der Burg <jur@avtware.com>
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=219580
+Signed-off-by: Scott Mayhew <smayhew@redhat.com>
+Reviewed-by: Jeff Layton <jlayton@kernel.org>
+Tested-by: Salvatore Bonaccorso <carnil@debian.org>
+Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfsd/nfs4recover.c |    1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/fs/nfsd/nfs4recover.c
++++ b/fs/nfsd/nfs4recover.c
+@@ -2052,7 +2052,6 @@ static inline int check_for_legacy_metho
+               path_put(&path);
+               if (status)
+                       return -ENOTDIR;
+-              status = nn->client_tracking_ops->init(net);
+       }
+       return status;
+ }
index e51dfb991ca1480eb8168cabe0eeb3d93b97be9f..d2e00fd2dae50a1bfc700fb14361dec1fb18425c 100644 (file)
@@ -1,3 +1,5 @@
 alsa-usb-audio-add-quirk-for-plantronics-headsets-to-fix-control-names.patch
 hid-hid-plantronics-add-mic-mute-mapping-and-generalize-quirks.patch
 atm-fix-null-pointer-dereference.patch
+nfsd-fix-legacy-client-tracking-initialization.patch
+cgroup-rstat-fix-forceidle-time-in-cpu.stat.patch