[PATCHSET v24.0 0/4] xfs: fix iget/irele usage in online fsck

Darrick J. Wong
2022-12-30T22:27:02Z

Hi all,

This patchset fixes a handful of problems relating to how we get and
release incore inodes in the online scrub code. The first patch fixes
how we handle DONTCACHE -- our reasons for setting (or clearing it)
depend entirely on the runtime environment at irele time. Hence we can
refactor iget and irele to use our own wrappers that set that context
appropriately.

The second patch fixes a race between the iget call in the inode core
scrubber and other writer threads that are allocating or freeing inodes
in the same AG by changing the behavior of xchk_iget (and the inode core
scrub setup function) to return either an incore inode or the AGI buffer
so that we can be sure that the inode cannot disappear on us.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything. Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=scrub-iget-fixes
---
fs/xfs/scrub/bmap.c | 2
fs/xfs/scrub/common.c | 267 +++++++++++++++++++++++++++++++++++++++++--------
fs/xfs/scrub/common.h | 10 ++
fs/xfs/scrub/dir.c | 2
fs/xfs/scrub/inode.c | 180 ++++++++++++++++++++++++++++-----
fs/xfs/scrub/parent.c | 9 +-
fs/xfs/scrub/scrub.c | 2
fs/xfs/xfs_icache.c | 3 -
fs/xfs/xfs_icache.h | 11 +-
9 files changed, 398 insertions(+), 88 deletions(-)