xfs: scan the filesystem to repair a directory dotdot entry
authorDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:54:52 +0000 (14:54 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 15 Apr 2024 21:58:56 +0000 (14:58 -0700)
commita07b45576264e77ea1a781b552873e76b8b0dacc
tree8fd98c538eaba30f9da8107cf640cbb4abca4245
parentb1991ee3e7cf852e95a3498801303cfbb4468681
xfs: scan the filesystem to repair a directory dotdot entry

Teach the online directory repair code to scan the filesystem so that we
can set the dotdot entry when we're rebuilding a directory.  This
involves dropping ILOCK on the directory that we're repairing, which
means that the VFS can sneak in and tell us to update dotdot at any
time.  Deal with these races by using a dirent hook to absorb dotdot
updates, and be careful not to check the scan results until after we've
retaken the ILOCK.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/Makefile
fs/xfs/scrub/dir_repair.c
fs/xfs/scrub/findparent.c [new file with mode: 0644]
fs/xfs/scrub/findparent.h [new file with mode: 0644]
fs/xfs/scrub/iscan.c
fs/xfs/scrub/iscan.h
fs/xfs/scrub/trace.h