diff options
author | Christoph Hellwig <hch@lst.de> | 2023-10-14 07:50:35 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2025-03-03 08:16:44 -0700 |
commit | 8ae4c8cec0bb4f437c16ba5f4b4d63a1f3a87062 (patch) | |
tree | 415fb6f3f2999be3f46ac56be9e03974a1232770 /fs/xfs/xfs_reflink.c | |
parent | 7c879c8275c0505c551f0fc6c152299c8d11f756 (diff) |
xfs: skip always_cow inodes in xfs_reflink_trim_around_shared
xfs_reflink_trim_around_shared tries to find shared blocks in the
refcount btree. Always_cow inodes don't have that tree, so don't
bother.
For the existing always_cow code this is a minor optimization. For
the upcoming zoned code that can do COW without the rtreflink code it
avoids triggering a NULL pointer dereference.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_reflink.c')
-rw-r--r-- | fs/xfs/xfs_reflink.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_reflink.c b/fs/xfs/xfs_reflink.c index b21cb0d36dd4..fd65e5d7994a 100644 --- a/fs/xfs/xfs_reflink.c +++ b/fs/xfs/xfs_reflink.c @@ -235,7 +235,7 @@ xfs_reflink_trim_around_shared( int error = 0; /* Holes, unwritten, and delalloc extents cannot be shared */ - if (!xfs_is_cow_inode(ip) || !xfs_bmap_is_written_extent(irec)) { + if (!xfs_is_reflink_inode(ip) || !xfs_bmap_is_written_extent(irec)) { *shared = false; return 0; } |