]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.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)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 10 Dec 2020 11:06:29 +0000 (12:06 +0100)
BugLink: https://bugs.launchpad.net/bugs/1905618
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/xfs/scrub/bmap.c

index 392fb4df5c12754d5de3a0c1f045e78635e24547..ec580c0d70fa36afde913a439a23475d48d83194 100644 (file)
@@ -113,6 +113,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