@@ -149,6 +149,11 @@ const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR] = {
.descr = "retained health records",
.group = XFROG_SCRUB_GROUP_NONE,
},
+ [XFS_SCRUB_TYPE_DIRTREE] = {
+ .name = "dirtree",
+ .descr = "directory tree structure",
+ .group = XFROG_SCRUB_GROUP_INODE,
+ },
};
#undef DEP
@@ -719,9 +719,10 @@ struct xfs_scrub_metadata {
#define XFS_SCRUB_TYPE_QUOTACHECK 25 /* quota counters */
#define XFS_SCRUB_TYPE_NLINKS 26 /* inode link counts */
#define XFS_SCRUB_TYPE_HEALTHY 27 /* everything checked out ok */
+#define XFS_SCRUB_TYPE_DIRTREE 28 /* directory tree structure */
/* Number of scrub subcommands. */
-#define XFS_SCRUB_TYPE_NR 28
+#define XFS_SCRUB_TYPE_NR 29
/* i: Repair this metadata. */
#define XFS_SCRUB_IFLAG_REPAIR (1u << 0)
@@ -148,6 +148,20 @@ that points back to the subdirectory.
The inode to examine can be specified in the same manner as
.BR XFS_SCRUB_TYPE_INODE "."
+.TP
+.B XFS_SCRUB_TYPE_DIRTREE
+This scrubber looks for problems in the directory tree structure such as loops
+and directories accessible through more than one path.
+Problems are detected by walking parent pointers upwards towards the root.
+Loops are detected by comparing the parent directory at each step against the
+directories already examined.
+Directories with multiple paths are detected by counting the parent pointers
+attached to a directory.
+Non-directories do not have links pointing away from the directory tree root
+and can be skipped.
+The directory to examine can be specified in the same manner as
+.BR XFS_SCRUB_TYPE_INODE "."
+
.TP
.B XFS_SCRUB_TYPE_SYMLINK
Examine the target of a symbolic link for obvious pathname problems.