[PATCHSET 5/5] xfsprogs: dump fs directory trees

Darrick J. Wong
2025-02-06T22:30:39Z

Hi all,

Before we disable XFS V4 support by default in the kernel ahead of
abandoning the old ondisk format in 2030, let's create a userspace
extraction tool so that in the future, people can extract their files
without needing to load an old kernel or figure out how to set up
lklfuse. This also enables at least partial data recovery from
filesystems that cannot be mounted due to severe or unfixable
inconsistencies.

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

xfsprogs git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=rdump

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=rdump
---
Commits in this patchset:
* xfs_db: pass const pointers when we're not modifying them
* xfs_db: use an empty transaction to try to prevent livelocks in path_navigate
* xfs_db: make listdir more generally useful
* xfs_db: add command to copy directory trees out of filesystems
---
db/Makefile | 3
db/command.c | 1
db/command.h | 1
db/namei.c | 115 ++++-
db/namei.h | 18 +
db/rdump.c | 999 ++++++++++++++++++++++++++++++++++++++++++++++
libxfs/libxfs_api_defs.h | 2
man/man8/xfs_db.8 | 26 +
8 files changed, 1126 insertions(+), 39 deletions(-)
create mode 100644 db/namei.h
create mode 100644 db/rdump.c