summaryrefslogtreecommitdiff
path: root/fs/xfs/scrub/inode.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-29 11:04:25 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-11-09 19:07:16 -0800
commiteda0e35702b5092cf6ad5cf4f5f4f2ccc1a1a023 (patch)
tree2530390240e449933ec2395c834fd078e3baab8b /fs/xfs/scrub/inode.c
parentd55e214fbc697a76ea0fc1520ffe97c40fa84466 (diff)
xfs: ensure that all metadata and data blocks are not cow staging extentsscrub-detect-refcount-gaps_2022-11-09
Make sure that all filesystem metadata blocks and file data blocks are not also marked as CoW staging extents. The extra checking added here was inspired by an actual VM host filesystem corruption incident due to bugs in the CoW handling of 4.x kernels. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/scrub/inode.c')
-rw-r--r--fs/xfs/scrub/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/scrub/inode.c b/fs/xfs/scrub/inode.c
index 998bf06d2347..a68ba8684465 100644
--- a/fs/xfs/scrub/inode.c
+++ b/fs/xfs/scrub/inode.c
@@ -558,6 +558,7 @@ xchk_inode_xref(
xchk_inode_xref_finobt(sc, ino);
xchk_xref_is_owned_by(sc, agbno, 1, &XFS_RMAP_OINFO_INODES);
xchk_xref_is_not_shared(sc, agbno, 1);
+ xchk_xref_is_not_cow_staging(sc, agbno, 1);
xchk_inode_xref_bmap(sc, dip);
out_free: