diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-08-10 16:48:13 +0200 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2023-08-10 16:48:13 +0200 |
commit | e27a1369a9c1907086e6bf8735504a88394074c9 (patch) | |
tree | c81ef9b21021267d01612652233c98efb71d91ce /fs/xfs | |
parent | xfs: simplify returns in xchk_bmap (diff) | |
download | linux-e27a1369a9c1907086e6bf8735504a88394074c9.tar.xz linux-e27a1369a9c1907086e6bf8735504a88394074c9.zip |
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>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/scrub/bmap.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/xfs/scrub/bmap.c b/fs/xfs/scrub/bmap.c index f1e732d4fefd..75588915572e 100644 --- a/fs/xfs/scrub/bmap.c +++ b/fs/xfs/scrub/bmap.c @@ -850,8 +850,8 @@ xchk_bmap( switch (whichfork) { case XFS_COW_FORK: - /* No CoW forks on non-reflink inodes/filesystems. */ - if (!xfs_is_reflink_inode(ip)) { + /* No CoW forks on non-reflink filesystems. */ + if (!xfs_has_reflink(mp)) { xchk_ino_set_corrupt(sc, sc->ip->i_ino); return 0; } @@ -955,8 +955,5 @@ int xchk_bmap_cow( struct xfs_scrub *sc) { - if (!xfs_is_reflink_inode(sc->ip)) - return -ENOENT; - return xchk_bmap(sc, XFS_COW_FORK); } |