xfs: don't check reflink iflag state when checking cow fork
authorDarrick J. Wong <djwong@kernel.org>
Thu, 10 Aug 2023 14:48:13 +0000 (07:48 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 10 Aug 2023 14:48:13 +0000 (07:48 -0700)
commite27a1369a9c1907086e6bf8735504a88394074c9
treec81ef9b21021267d01612652233c98efb71d91ce
parent65092ca1402cb7d640c6f65d3c19eb02bf08ead1
xfs: don't check reflink iflag state when checking cow fork

Any inode on a reflink filesystem can have a cow fork, even if the inode
does not have the reflink iflag set.  This happens either because the
inode once had the iflag set but does not now, because we don't free the
incore cow fork until the icache deletes the inode; or because we're
running in alwayscow mode.

Either way, we can collapse both of the xfs_is_reflink_inode calls into
one, and change it to xfs_has_reflink, now that the bmap checker will
return ENOENT if there is no pointer to the incore fork.

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