@@ -139,6 +139,11 @@ const struct xfrog_scrub_descr xfrog_scrubbers[XFS_SCRUB_TYPE_NR] = {
.descr = "quota counters",
.group = XFROG_SCRUB_GROUP_ISCAN,
},
+ [XFS_SCRUB_TYPE_NLINKS] = {
+ .name = "nlinks",
+ .descr = "inode link counts",
+ .group = XFROG_SCRUB_GROUP_ISCAN,
+ },
};
/* Invoke the scrub ioctl. Returns zero or negative error code. */
@@ -159,6 +159,17 @@ struct xfs_da3_intnode {
#define XFS_DIR3_FT_MAX 9
+#define XFS_DIR3_FTYPE_STR \
+ { XFS_DIR3_FT_UNKNOWN, "unknown" }, \
+ { XFS_DIR3_FT_REG_FILE, "file" }, \
+ { XFS_DIR3_FT_DIR, "directory" }, \
+ { XFS_DIR3_FT_CHRDEV, "char" }, \
+ { XFS_DIR3_FT_BLKDEV, "block" }, \
+ { XFS_DIR3_FT_FIFO, "fifo" }, \
+ { XFS_DIR3_FT_SOCK, "sock" }, \
+ { XFS_DIR3_FT_SYMLINK, "symlink" }, \
+ { XFS_DIR3_FT_WHT, "whiteout" }
+
/*
* Byte offset in data block and shortform entry.
*/
@@ -24,6 +24,12 @@ const struct xfs_name xfs_name_dotdot = {
.type = XFS_DIR3_FT_DIR,
};
+const struct xfs_name xfs_name_dot = {
+ .name = (unsigned char *)".",
+ .len = 1,
+ .type = XFS_DIR3_FT_DIR,
+};
+
/*
* Convert inode mode to directory entry filetype
*/
@@ -22,6 +22,7 @@ struct xfs_dir3_icfree_hdr;
struct xfs_dir3_icleaf_hdr;
extern const struct xfs_name xfs_name_dotdot;
+extern const struct xfs_name xfs_name_dot;
/*
* Convert inode mode to directory entry filetype
@@ -710,9 +710,10 @@ struct xfs_scrub_metadata {
#define XFS_SCRUB_TYPE_PQUOTA 23 /* project quotas */
#define XFS_SCRUB_TYPE_FSCOUNTERS 24 /* fs summary counters */
#define XFS_SCRUB_TYPE_QUOTACHECK 25 /* quota counters */
+#define XFS_SCRUB_TYPE_NLINKS 26 /* inode link counts */
/* Number of scrub subcommands. */
-#define XFS_SCRUB_TYPE_NR 26
+#define XFS_SCRUB_TYPE_NR 27
/* i: Repair this metadata. */
#define XFS_SCRUB_IFLAG_REPAIR (1u << 0)
@@ -164,6 +164,10 @@ Examine all user, group, or project quota records for corruption.
.B XFS_SCRUB_TYPE_FSCOUNTERS
Examine all filesystem summary counters (free blocks, inode count, free inode
count) for errors.
+
+.TP
+.B XFS_SCRUB_TYPE_NLINKS
+Scan all inodes in the filesystem to verify each file's link count.
.RE
.PD 1
@@ -23,10 +23,6 @@ static struct cred zerocr;
static struct fsxattr zerofsx;
static xfs_ino_t orphanage_ino;
-static struct xfs_name xfs_name_dot = {(unsigned char *)".",
- 1,
- XFS_DIR3_FT_DIR};
-
/*
* Data structures used to keep track of directories where the ".."
* entries are updated. These must be rebuilt after the initial pass