]> git.hungrycats.org Git - linux/commit
btrfs: use aligned range for locking in reflink
authorQu Wenruo <wqu@suse.com>
Tue, 28 Jul 2026 09:11:23 +0000 (18:41 +0930)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Aug 2026 17:17:18 +0000 (19:17 +0200)
commite7f4c05a8307701da8bc8d0391540adf6c13fcfe
treef2d318738fff626f57998bed511a3f3ebb008550
parent681e073614515b892cacef0eeec0c761a2c2ab87
btrfs: use aligned range for locking in reflink

In btrfs_extent_same_range() and btrfs_clone_files(), the range passed
into btrfs_lock_extent() is not aligned at its end, because we can
reflink until the EOF, which may not be block aligned.

Although this is not a big deal, for the sake of consistency, and to
prepare for the upcoming stricter alignment check, pass an aligned range
end to btrfs_lock_extent() and btrfs_unlock_extent().

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/reflink.c