]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs: report directory tree corruption in the health information
authorDarrick J. Wong <djwong@kernel.org>
Tue, 9 Jan 2024 17:39:30 +0000 (09:39 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 10 Apr 2024 00:21:32 +0000 (17:21 -0700)
Report directories that are the source of corruption in the directory
tree.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
libxfs/xfs_fs.h
libxfs/xfs_health.h
man/man2/ioctl_xfs_bulkstat.2
man/man2/ioctl_xfs_fsbulkstat.2
spaceman/health.c

index da0f427a09730c113de455bd441998037a8d2767..f2d2c1db18e5335952c4a3e2dd593bd567314441 100644 (file)
@@ -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
index 3c64b5f9bd6817af320d86e6839d2933293e7dea..b0edb4288e59297ea5a6a54c67da1d70ea471d0c 100644 (file)
@@ -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 | \
index 3203ca0c5d27b776d69e99663963a9d0f77cdf8e..b6d51aa438111dab32945b7690fb637c00d70b2f 100644 (file)
@@ -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:
index 3f059942a219cf05b94e287725e8f2f29250a9e1..cd38d2fd6f268ab9099e817eb3af1acf463a5250 100644 (file)
@@ -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
index 6722babf5888bc1735d07cfc91e254f43073841c..d88a7f6c6e53f2966a4b9d461cd1f2f1d63be062 100644 (file)
@@ -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},
 };