]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
xfs: set the unwritten bit in rmap lookup flags in xchk_bmap_get_rmapextents
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 9 Nov 2020 00:32:43 +0000 (16:32 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Nov 2020 18:18:47 +0000 (19:18 +0100)
[ Upstream commit 5dda3897fd90783358c4c6115ef86047d8c8f503 ]

When the bmbt scrubber is looking up rmap extents, we need to set the
extent flags from the bmbt record fully.  This will matter once we fix
the rmap btree comparison functions to check those flags correctly.

Fixes: d852657ccfc0 ("xfs: cross-reference reverse-mapping btree")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/scrub/bmap.c

index f84a58e523bc83a72d0f50cbf34c017cc290a206..b05d65fd360b328d50003df0f3b496f91fc5942a 100644 (file)
@@ -120,6 +120,8 @@ xchk_bmap_get_rmap(
 
        if (info->whichfork == XFS_ATTR_FORK)
                rflags |= XFS_RMAP_ATTR_FORK;
+       if (irec->br_state == XFS_EXT_UNWRITTEN)
+               rflags |= XFS_RMAP_UNWRITTEN;
 
        /*
         * CoW staging extents are owned (on disk) by the refcountbt, so