mbox series

[PATCHSET,v11,0/3] xfs: online repair of directories

Message ID 168080825278.615785.11418750801629760336.stgit@frogsfrogsfrogs (mailing list archive)
Headers show
Series xfs: online repair of directories | expand

Message

Darrick J. Wong April 6, 2023, 7:14 p.m. UTC
Hi all,

With this patchset, we implement online reconstruction of directories by
scanning the entire filesystem looking for parent pointer data.  This
mostly works, except for the part where we need to resync the diroffset
field of the parent pointers to match the new directory structure.

Fixing that is left as an open research question, with a few possible
solutions:

1. As part of committing the new directory, queue a bunch of parent
pointer updates to make those changes.

2. Leave them inconsistent and let the parent pointer repair fix it.

3. Change the ondisk format of parent pointers (and xattrs) so that we
can encode the full dirent name in the xattr name.

4. Change the ondisk format of parent pointers to encode a sha256 hash
of the dirent name in the xattr name.  This will work as long as nobody
breaks sha256.

Thoughts?  Note that the atomic swapext and block reaping code is NOT
ported for this PoC, so we do not commit any repairs.

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.
kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=pptrs-online-dir-repair

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=pptrs-online-dir-repair
---
 fs/xfs/Makefile           |    1 
 fs/xfs/libxfs/xfs_dir2.c  |    2 
 fs/xfs/libxfs/xfs_dir2.h  |    2 
 fs/xfs/scrub/common.c     |   15 +
 fs/xfs/scrub/common.h     |   28 +
 fs/xfs/scrub/dir.c        |    9 
 fs/xfs/scrub/dir_repair.c | 1125 +++++++++++++++++++++++++++++++++++++++++++++
 fs/xfs/scrub/repair.h     |   16 +
 fs/xfs/scrub/scrub.c      |    2 
 fs/xfs/scrub/tempfile.c   |   42 ++
 fs/xfs/scrub/tempfile.h   |    2 
 fs/xfs/scrub/trace.c      |    1 
 fs/xfs/scrub/trace.h      |   65 +++
 13 files changed, 1307 insertions(+), 3 deletions(-)
 create mode 100644 fs/xfs/scrub/dir_repair.c