[PATCHSET v12.0 00/14] xfsprogs: fsck for parent pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

This series implements online checking and repair for directory parent
pointer metadata.  The checking half is fairly straightforward -- for
each outgoing directory link (forward or backwards), grab the inode at
the other end, and confirm that there's a corresponding link.  If we
can't grab an inode or lock it, we'll save that link for a slower loop
that cycles all the locks, confirms the continued existence of the link,
and rechecks the link if it's actually still there.

Repairs are a bit more involved -- for directories, we walk the entire
filesystem to rebuild the dirents from parent pointer information.
Parent pointer repairs do the same walk but rebuild the pptrs from the
dirent information, but with the added twist that it duplicates all the
xattrs so that it can use the atomic extent swapping code to commit the
repairs atomically.

This introduces an added twist to the xattr repair code -- because the
VFS doesn't take i_rwsem on directory children when moving them from one
parent to another, we use dirent hooks to detect a colliding update to
the pptr data; if one is detected, we restart the xattr salvaging
process but this time hold all the ILOCKs until the end of the scan.

For offline repair, the phase6 directory connectivity scan generates an
index of all the expected parent pointers in the filesystem.  Then it
walks each file and compares the parent pointers attached to that file
against the index generated, and resyncs the results as necessary.

The last patch teaches xfs_scrub to report pathnames of files that are
being repaired, when possible.

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=pptrs-fsck

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=pptrs-fsck
---
 libxfs/Makefile          |    2 
 libxfs/libxfs_api_defs.h |    4 
 libxfs/xfblob.c          |  157 ++++++
 libxfs/xfblob.h          |   27 +
 libxfs/xfile.c           |   11 
 libxfs/xfile.h           |    1 
 libxfs/xfs_bmap.c        |    2 
 libxfs/xfs_dir2.c        |    2 
 libxfs/xfs_dir2.h        |    2 
 libxfs/xfs_parent.c      |   86 +++
 libxfs/xfs_parent.h      |   18 +
 repair/Makefile          |    6 
 repair/listxattr.c       |  271 ++++++++++
 repair/listxattr.h       |   15 +
 repair/phase6.c          |  116 ++++
 repair/pptr.c            | 1274 ++++++++++++++++++++++++++++++++++++++++++++++
 repair/pptr.h            |   17 +
 repair/strblobs.c        |  212 ++++++++
 repair/strblobs.h        |   24 +
 scrub/phase6.c           |   62 ++
 20 files changed, 2291 insertions(+), 18 deletions(-)
 create mode 100644 libxfs/xfblob.c
 create mode 100644 libxfs/xfblob.h
 create mode 100644 repair/listxattr.c
 create mode 100644 repair/listxattr.h
 create mode 100644 repair/pptr.c
 create mode 100644 repair/pptr.h
 create mode 100644 repair/strblobs.c
 create mode 100644 repair/strblobs.h




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux