On Tue, Feb 09, 2021 at 09:13:36AM +0000, Christoph Hellwig wrote: > On Mon, Feb 08, 2021 at 08:10:44PM -0800, Darrick J. Wong wrote: > > From: Darrick J. Wong <djwong@xxxxxxxxxx> > > > > There are a few places in xfs_repair's directory checking code where we > > deliberately corrupt a directory entry as a sentinel to trigger a > > correction in later repair phase. In the mean time, the filesystem is > > inconsistent, so set the needsrepair flag to force a re-run of repair if > > the system goes down. > > I guess this is an improvement over what we have no, but I suspect an > in-core side band way to notify the later phases would be much better > than these corrupt sentinel values.. It would be, but we'd still have to track which directory entries are thee ones that we don't want to preserve. We could rewrite the directory entry to point to a plausible inode number that isn't allocated, but that runs the risk that someone will come along and allocate that inode for lost+found and then we're really in a mess. Alternately, I suppose we could rewrite the directory entry to be a DHT_WHITEOUT entry that doesn't look like any that the kernel would produce ... insofar as I'm not even sure what the real ones were supposed to look like, given the weird left turn that overlayfs took on that. :( --D