mbox series

[PATCHSET,v23.1,0/3] xfs: fix iget/irele usage in online fsck

Message ID 166473482923.1084685.3060991494529121939.stgit@magnolia (mailing list archive)
Headers show
Series xfs: fix iget/irele usage in online fsck | expand

Message

Darrick J. Wong Oct. 2, 2022, 6:20 p.m. UTC
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/common.c |  251 +++++++++++++++++++++++++++++++++++++++++--------
 fs/xfs/scrub/common.h |    8 ++
 fs/xfs/scrub/dir.c    |    2 
 fs/xfs/scrub/inode.c  |  163 ++++++++++++++++++++++++++++----
 fs/xfs/scrub/parent.c |    5 -
 fs/xfs/scrub/scrub.c  |    2 
 fs/xfs/xfs_icache.c   |    3 -
 fs/xfs/xfs_icache.h   |    1 
 8 files changed, 368 insertions(+), 67 deletions(-)