mbox series

[GIT,PULL,2/3] xfs: percpu counter bug fixes for 6.3-rc3

Message ID 167976583201.986322.4007693111843261305.stg-ugh@frogsfrogsfrogs (mailing list archive)
State New, archived
Headers show
Series [GIT,PULL,1/3] xfs: bug fixes for 6.3-rc2 | expand

Pull-request

git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git tags/xfs-6.3-fixes-4

Message

Darrick J. Wong March 25, 2023, 6:33 p.m. UTC
Hi Linus,

Please pull this branch with a correction to the percpu counter
summation code.  We discovered a filesystem summary counter corruption
problem that was traced to cpu hot-remove racing with the call to
percpu_counter_sum that sets the free block count in the superblock when
writing it to disk.  The root cause is that percpu_counter_sum doesn't
cull from dying cpus and hence misses those counter values if the cpu
shutdown hooks have not yet run to merge the values.

I'm hoping this is a fairly painless fix to the problem, since the dying
cpu mask should generally be empty.  It's been in for-next for a week
without any complaints from the bots.  However, if this is too much for
a bug fix, we could defer to 6.4.

As usual, I did a test-merge with the main upstream branch as of a few
minutes ago, and didn't see any conflicts.  Please let me know if you
encounter any problems.

--D

The following changes since commit 3cfb9290da3d87a5877b03bda96c3d5d3ed9fcb0:

xfs: test dir/attr hash when loading module (2023-03-19 09:55:49 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git tags/xfs-6.3-fixes-4

for you to fetch changes up to e9b60c7f97130795c7aa81a649ae4b93a172a277:

pcpcntr: remove percpu_counter_sum_all() (2023-03-19 10:02:04 -0700)

----------------------------------------------------------------
Fixes for 6.3-rc3:

* Fix a race in the percpu counters summation code where the summation
failed to add in the values for any CPUs that were dying but not yet
dead.  This fixes some minor discrepancies and incorrect assertions
when running generic/650.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>

----------------------------------------------------------------
Dave Chinner (4):
cpumask: introduce for_each_cpu_or
pcpcntrs: fix dying cpu summation race
fork: remove use of percpu_counter_sum_all
pcpcntr: remove percpu_counter_sum_all()

include/linux/cpumask.h        | 17 +++++++++++++++++
include/linux/find.h           | 37 +++++++++++++++++++++++++++++++++++++
include/linux/percpu_counter.h |  6 ------
kernel/fork.c                  |  5 -----
lib/find_bit.c                 |  9 +++++++++
lib/percpu_counter.c           | 37 ++++++++++++++-----------------------
6 files changed, 77 insertions(+), 34 deletions(-)

Comments

Linus Torvalds March 25, 2023, 8:05 p.m. UTC | #1
On Sat, Mar 25, 2023 at 11:33 AM Darrick J. Wong <djwong@kernel.org> wrote:
>
> I'm hoping this is a fairly painless fix to the problem, since the dying
> cpu mask should generally be empty.  It's been in for-next for a week
> without any complaints from the bots.  However, if this is too much for
> a bug fix, we could defer to 6.4.

I'm not overly happy about the timing of the fix and it would have
been lovely to get this earlier in the release, but it does seem quite
sane and fairly straightforward.

So in it went,

                Linus
pr-tracker-bot@kernel.org March 25, 2023, 8:20 p.m. UTC | #2
The pull request you sent on Sat, 25 Mar 2023 11:33:16 -0700:

> git://git.kernel.org/pub/scm/fs/xfs/xfs-linux.git tags/xfs-6.3-fixes-4

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/fcde88af6a783d32e735dd2615528e2bf7a0f533

Thank you!