From: Darrick J. Wong Date: Tue, 9 Jan 2024 17:39:30 +0000 (-0800) Subject: xfs: report directory tree corruption in the health information X-Git-Tag: xfs-zoned-old-2024-06-10~322 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fbaedf6b8a4735c402ea949f3339ed8da0690c9d;p=users%2Fhch%2Fxfsprogs.git xfs: report directory tree corruption in the health information Report directories that are the source of corruption in the directory tree. Signed-off-by: Darrick J. Wong --- diff --git a/libxfs/xfs_fs.h b/libxfs/xfs_fs.h index da0f427a0..f2d2c1db1 100644 --- a/libxfs/xfs_fs.h +++ b/libxfs/xfs_fs.h @@ -412,6 +412,7 @@ struct xfs_bulkstat { #define XFS_BS_SICK_XATTR (1 << 5) /* extended attributes */ #define XFS_BS_SICK_SYMLINK (1 << 6) /* symbolic link remote target */ #define XFS_BS_SICK_PARENT (1 << 7) /* parent pointers */ +#define XFS_BS_SICK_DIRTREE (1 << 8) /* directory tree structure */ /* * Project quota id helpers (previously projid was 16bit only diff --git a/libxfs/xfs_health.h b/libxfs/xfs_health.h index 3c64b5f9b..b0edb4288 100644 --- a/libxfs/xfs_health.h +++ b/libxfs/xfs_health.h @@ -95,6 +95,7 @@ struct xfs_da_args; /* Don't propagate sick status to ag health summary during inactivation */ #define XFS_SICK_INO_FORGET (1 << 12) +#define XFS_SICK_INO_DIRTREE (1 << 13) /* directory tree structure */ /* Primary evidence of health problems in a given group. */ #define XFS_SICK_FS_PRIMARY (XFS_SICK_FS_COUNTERS | \ @@ -125,7 +126,8 @@ struct xfs_da_args; XFS_SICK_INO_DIR | \ XFS_SICK_INO_XATTR | \ XFS_SICK_INO_SYMLINK | \ - XFS_SICK_INO_PARENT) + XFS_SICK_INO_PARENT | \ + XFS_SICK_INO_DIRTREE) #define XFS_SICK_INO_ZAPPED (XFS_SICK_INO_BMBTD_ZAPPED | \ XFS_SICK_INO_BMBTA_ZAPPED | \ diff --git a/man/man2/ioctl_xfs_bulkstat.2 b/man/man2/ioctl_xfs_bulkstat.2 index 3203ca0c5..b6d51aa43 100644 --- a/man/man2/ioctl_xfs_bulkstat.2 +++ b/man/man2/ioctl_xfs_bulkstat.2 @@ -326,6 +326,9 @@ Symbolic link target. .TP .B XFS_BS_SICK_PARENT Parent pointers. +.TP +.B XFS_BS_SICK_DIRTREE +Directory is the source of corruption in the directory tree. .RE .SH ERRORS Error codes can be one of, but are not limited to, the following: diff --git a/man/man2/ioctl_xfs_fsbulkstat.2 b/man/man2/ioctl_xfs_fsbulkstat.2 index 3f059942a..cd38d2fd6 100644 --- a/man/man2/ioctl_xfs_fsbulkstat.2 +++ b/man/man2/ioctl_xfs_fsbulkstat.2 @@ -239,6 +239,9 @@ Symbolic link target. .TP .B XFS_BS_SICK_PARENT Parent pointers. +.TP +.B XFS_BS_SICK_DIRTREE +Directory is the source of corruption in the directory tree. .RE .SH RETURN VALUE On error, \-1 is returned, and diff --git a/spaceman/health.c b/spaceman/health.c index 6722babf5..d88a7f6c6 100644 --- a/spaceman/health.c +++ b/spaceman/health.c @@ -165,6 +165,10 @@ static const struct flag_map inode_flags[] = { .mask = XFS_BS_SICK_PARENT, .descr = "parent pointers", }, + { + .mask = XFS_BS_SICK_DIRTREE, + .descr = "directory tree structure", + }, {0}, };