Commit 99d9d8d0 authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: scrub inode block mappings

Scrub an individual inode's block mappings to make sure they make sense.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
parent 80e4e126
...@@ -145,6 +145,7 @@ xfs-y += $(addprefix scrub/, \ ...@@ -145,6 +145,7 @@ xfs-y += $(addprefix scrub/, \
trace.o \ trace.o \
agheader.o \ agheader.o \
alloc.o \ alloc.o \
bmap.o \
btree.o \ btree.o \
common.o \ common.o \
ialloc.o \ ialloc.o \
......
...@@ -495,9 +495,12 @@ struct xfs_scrub_metadata { ...@@ -495,9 +495,12 @@ struct xfs_scrub_metadata {
#define XFS_SCRUB_TYPE_RMAPBT 9 /* reverse mapping btree */ #define XFS_SCRUB_TYPE_RMAPBT 9 /* reverse mapping btree */
#define XFS_SCRUB_TYPE_REFCNTBT 10 /* reference count btree */ #define XFS_SCRUB_TYPE_REFCNTBT 10 /* reference count btree */
#define XFS_SCRUB_TYPE_INODE 11 /* inode record */ #define XFS_SCRUB_TYPE_INODE 11 /* inode record */
#define XFS_SCRUB_TYPE_BMBTD 12 /* data fork block mapping */
#define XFS_SCRUB_TYPE_BMBTA 13 /* attr fork block mapping */
#define XFS_SCRUB_TYPE_BMBTC 14 /* CoW fork block mapping */
/* Number of scrub subcommands. */ /* Number of scrub subcommands. */
#define XFS_SCRUB_TYPE_NR 12 #define XFS_SCRUB_TYPE_NR 15
/* i: Repair this metadata. */ /* i: Repair this metadata. */
#define XFS_SCRUB_IFLAG_REPAIR (1 << 0) #define XFS_SCRUB_IFLAG_REPAIR (1 << 0)
......
This diff is collapsed.
...@@ -89,7 +89,10 @@ int xfs_scrub_setup_ag_refcountbt(struct xfs_scrub_context *sc, ...@@ -89,7 +89,10 @@ int xfs_scrub_setup_ag_refcountbt(struct xfs_scrub_context *sc,
struct xfs_inode *ip); struct xfs_inode *ip);
int xfs_scrub_setup_inode(struct xfs_scrub_context *sc, int xfs_scrub_setup_inode(struct xfs_scrub_context *sc,
struct xfs_inode *ip); struct xfs_inode *ip);
int xfs_scrub_setup_inode_bmap(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
int xfs_scrub_setup_inode_bmap_data(struct xfs_scrub_context *sc,
struct xfs_inode *ip);
void xfs_scrub_ag_free(struct xfs_scrub_context *sc, struct xfs_scrub_ag *sa); void xfs_scrub_ag_free(struct xfs_scrub_context *sc, struct xfs_scrub_ag *sa);
int xfs_scrub_ag_init(struct xfs_scrub_context *sc, xfs_agnumber_t agno, int xfs_scrub_ag_init(struct xfs_scrub_context *sc, xfs_agnumber_t agno,
......
...@@ -215,6 +215,18 @@ static const struct xfs_scrub_meta_ops meta_scrub_ops[] = { ...@@ -215,6 +215,18 @@ static const struct xfs_scrub_meta_ops meta_scrub_ops[] = {
.setup = xfs_scrub_setup_inode, .setup = xfs_scrub_setup_inode,
.scrub = xfs_scrub_inode, .scrub = xfs_scrub_inode,
}, },
{ /* inode data fork */
.setup = xfs_scrub_setup_inode_bmap,
.scrub = xfs_scrub_bmap_data,
},
{ /* inode attr fork */
.setup = xfs_scrub_setup_inode_bmap,
.scrub = xfs_scrub_bmap_attr,
},
{ /* inode CoW fork */
.setup = xfs_scrub_setup_inode_bmap,
.scrub = xfs_scrub_bmap_cow,
},
}; };
/* This isn't a stable feature, warn once per day. */ /* This isn't a stable feature, warn once per day. */
......
...@@ -79,5 +79,8 @@ int xfs_scrub_finobt(struct xfs_scrub_context *sc); ...@@ -79,5 +79,8 @@ int xfs_scrub_finobt(struct xfs_scrub_context *sc);
int xfs_scrub_rmapbt(struct xfs_scrub_context *sc); int xfs_scrub_rmapbt(struct xfs_scrub_context *sc);
int xfs_scrub_refcountbt(struct xfs_scrub_context *sc); int xfs_scrub_refcountbt(struct xfs_scrub_context *sc);
int xfs_scrub_inode(struct xfs_scrub_context *sc); int xfs_scrub_inode(struct xfs_scrub_context *sc);
int xfs_scrub_bmap_data(struct xfs_scrub_context *sc);
int xfs_scrub_bmap_attr(struct xfs_scrub_context *sc);
int xfs_scrub_bmap_cow(struct xfs_scrub_context *sc);
#endif /* __XFS_SCRUB_SCRUB_H__ */ #endif /* __XFS_SCRUB_SCRUB_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment