diff options
author | Darrick J. Wong <djwong@kernel.org> | 2022-10-31 16:19:17 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2022-11-09 19:07:15 -0800 |
commit | 6e463931d17fdecd697fdbeb8a300e10911e43f1 (patch) | |
tree | 0d7f7dc2dbbbab3d9307063c52b032d1464911f0 | |
parent | 86dcc91dc08588f669df057d91c3315eb8ab4a0c (diff) |
xfs: hoist rmap record flag checks from scrub
Move the rmap record flag checks from xchk_rmapbt_rec into
xfs_rmap_check_irec so that they are applied everywhere.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
-rw-r--r-- | fs/xfs/libxfs/xfs_rmap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_rmap.c b/fs/xfs/libxfs/xfs_rmap.c index e66ecd794a84..da008d317f83 100644 --- a/fs/xfs/libxfs/xfs_rmap.c +++ b/fs/xfs/libxfs/xfs_rmap.c @@ -254,6 +254,11 @@ xfs_rmap_check_irec( if (!is_inode && (is_bmbt || is_unwritten || is_attr)) return __this_address; + /* Check for a valid fork offset, if applicable. */ + if (is_inode && !is_bmbt && + !xfs_verify_fileext(mp, irec->rm_offset, irec->rm_blockcount)) + return __this_address; + return NULL; } |