xfs: teach scrub to flag non-extents format cow forks
authorDarrick J. Wong <djwong@kernel.org>
Mon, 7 Nov 2022 01:03:22 +0000 (17:03 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Wed, 16 Nov 2022 23:25:05 +0000 (15:25 -0800)
CoW forks only exist in memory, which means that they can only ever have
an incore extent tree.  Hence they must always be FMT_EXTENTS, so check
this when we're scrubbing them.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/scrub/bmap.c

index 4bb6672..d50d0ea 100644 (file)
@@ -748,6 +748,8 @@ xchk_bmap(
        case XFS_DINODE_FMT_DEV:
        case XFS_DINODE_FMT_LOCAL:
                /* No mappings to check. */
+               if (whichfork == XFS_COW_FORK)
+                       xchk_fblock_set_corrupt(sc, whichfork, 0);
                goto out;
        case XFS_DINODE_FMT_EXTENTS:
                break;