Skip to content

Commit e27a136

Browse files
author
Darrick J. Wong
committed
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>
1 parent 65092ca commit e27a136

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

fs/xfs/scrub/bmap.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,8 @@ xchk_bmap(
850850

851851
switch (whichfork) {
852852
case XFS_COW_FORK:
853-
/* No CoW forks on non-reflink inodes/filesystems. */
854-
if (!xfs_is_reflink_inode(ip)) {
853+
/* No CoW forks on non-reflink filesystems. */
854+
if (!xfs_has_reflink(mp)) {
855855
xchk_ino_set_corrupt(sc, sc->ip->i_ino);
856856
return 0;
857857
}
@@ -955,8 +955,5 @@ int
955955
xchk_bmap_cow(
956956
struct xfs_scrub *sc)
957957
{
958-
if (!xfs_is_reflink_inode(sc->ip))
959-
return -ENOENT;
960-
961958
return xchk_bmap(sc, XFS_COW_FORK);
962959
}

0 commit comments

Comments
 (0)