tag name | fix-percpu-lists-6.6_2023-09-19 (df0d5382ba7444e459f4c1e57fa0a26f9f61952f) |
tag date | 2023-09-19 08:57:02 -0700 |
tagged by | Darrick J. Wong <djwong@kernel.org> |
tagged object | commit ef7d959339... |
xfs: fix cpu hotplug mess [v2]
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.
v2: fix a few put_cpu uses, add necessary memory barriers, and use
atomic cpumask operations
This has been lightly tested with fstests. Enjoy!
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-----BEGIN PGP SIGNATURE-----
iHUEABYKAB0WIQQ2qTKExjcn+O1o2YRKO3ySh0YRpgUCZQnEzgAKCRBKO3ySh0YR
poe1AP4953szk1G+IPox1cBr8bLBbIJnjeHGCkE7PFugHqhjFQD9E2WJEPEeBQ9c
vN9GxA6oCw7kfMWbo6Z1ew6YLdbGWwA=
=cD6D
-----END PGP SIGNATURE-----