mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
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>
This commit is contained in:
parent
7c879c8275
commit
8ae4c8cec0
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user