Skip to content

Commit 928b721

Browse files
author
Darrick J. Wong
committed
xfs: teach online scrub to find directory tree structure problems
Create a new scrubber that detects corruptions within the directory tree structure itself. It can detect directories with multiple parents; loops within the directory tree; and directory loops not accessible from the root. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 327ed70 commit 928b721

File tree

12 files changed

+1168
-2
lines changed

12 files changed

+1168
-2
lines changed

fs/xfs/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ xfs-y += $(addprefix scrub/, \
163163
common.o \
164164
dabtree.o \
165165
dir.o \
166+
dirtree.o \
166167
fscounters.o \
167168
health.o \
168169
ialloc.o \

fs/xfs/libxfs/xfs_fs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,9 +719,10 @@ struct xfs_scrub_metadata {
719719
#define XFS_SCRUB_TYPE_QUOTACHECK 25 /* quota counters */
720720
#define XFS_SCRUB_TYPE_NLINKS 26 /* inode link counts */
721721
#define XFS_SCRUB_TYPE_HEALTHY 27 /* everything checked out ok */
722+
#define XFS_SCRUB_TYPE_DIRTREE 28 /* directory tree structure */
722723

723724
/* Number of scrub subcommands. */
724-
#define XFS_SCRUB_TYPE_NR 28
725+
#define XFS_SCRUB_TYPE_NR 29
725726

726727
/* i: Repair this metadata. */
727728
#define XFS_SCRUB_IFLAG_REPAIR (1u << 0)

fs/xfs/scrub/common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ int xchk_setup_directory(struct xfs_scrub *sc);
9292
int xchk_setup_xattr(struct xfs_scrub *sc);
9393
int xchk_setup_symlink(struct xfs_scrub *sc);
9494
int xchk_setup_parent(struct xfs_scrub *sc);
95+
int xchk_setup_dirtree(struct xfs_scrub *sc);
9596
#ifdef CONFIG_XFS_RT
9697
int xchk_setup_rtbitmap(struct xfs_scrub *sc);
9798
int xchk_setup_rtsummary(struct xfs_scrub *sc);

0 commit comments

Comments
 (0)