[PATCHSET v13.2 4/7] xfs: scrubbing for parent pointers

Darrick J. Wong
2024-04-16T01:20:19Z

Hi all,

Teach online fsck to use parent pointers to assist in checking
directories, parent pointers, extended attributes, and link counts.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

This has been running on the djcloud for months with no problems. 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-pptrs

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=scrub-pptrs
---
Commits in this patchset:
* xfs: revert commit 44af6c7e59b12
* xfs: check dirents have parent pointers
* xfs: deferred scrub of dirents
* xfs: scrub parent pointers
* xfs: deferred scrub of parent pointers
* xfs: walk directory parent pointers to determine backref count
* xfs: check parent pointer xattrs when scrubbing
---
fs/xfs/Makefile | 2
fs/xfs/libxfs/xfs_parent.c | 22 +
fs/xfs/libxfs/xfs_parent.h | 5
fs/xfs/scrub/attr.c | 27 +-
fs/xfs/scrub/common.h | 1
fs/xfs/scrub/dir.c | 342 +++++++++++++++++++++
fs/xfs/scrub/nlinks.c | 85 +++++
fs/xfs/scrub/nlinks_repair.c | 2
fs/xfs/scrub/parent.c | 685 ++++++++++++++++++++++++++++++++++++++++++
fs/xfs/scrub/readdir.c | 78 +++++
fs/xfs/scrub/readdir.h | 3
fs/xfs/scrub/trace.c | 1
fs/xfs/scrub/trace.h | 65 ++++
13 files changed, 1307 insertions(+), 11 deletions(-)