Merge tag 'fix-percpu-lists-6.6_2023-09-12' of https://git.kernel.org/pub/scm/linux...
authorChandan Babu R <chandanbabu@kernel.org>
Wed, 13 Sep 2023 04:41:44 +0000 (10:11 +0530)
committerChandan Babu R <chandanbabu@kernel.org>
Wed, 13 Sep 2023 04:41:44 +0000 (10:11 +0530)
commit0a229c935a8a0e0af1447f93128201bbfd3bb171
treed3897cef3938081847baa51a7835a968eaa4a3f0
parentda6f8410e73ebcdcdbcaf2d1bba0646193291e6b
parentef7d9593390a050c50eba5fc02d2cb65a1104434
Merge tag 'fix-percpu-lists-6.6_2023-09-12' of https://git./linux/kernel/git/djwong/xfs-linux into xfs-6.6-fixesA

xfs: fix cpu hotplug mess

Ritesh and Eric separately reported crashes in XFS's hook function for
CPU hot remove if the remove event races with a filesystem being
mounted.  I also noticed via generic/650 that once in a while the log
will shut down over an apparent overrun of a transaction reservation;
this turned out to be due to CIL percpu list aggregation failing to pick
up the percpu list items from a dying CPU.

Either way, the solution here is to eliminate the need for a CPU dying
hook by using a private cpumask to track which CPUs have added to their
percpu lists directly, and iterating with that mask.  This fixes the log
problems and (I think) solves a theoretical UAF bug in the inodegc code
too.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
* tag 'fix-percpu-lists-6.6_2023-09-12' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux:
  xfs: remove CPU hotplug infrastructure
  xfs: remove the all-mounts list
  xfs: use per-mount cpumask to track nonempty percpu inodegc lists
  xfs: fix per-cpu CIL structure aggregation racing with dying cpus