]> git.hungrycats.org Git - linux/commitdiff
Revert "Btrfs: make deduplication with range including the last block work"
authorZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sat, 28 Dec 2019 21:23:23 +0000 (16:23 -0500)
committerZygo Blaxell <ce3g8jdj@umail.furryterror.org>
Sun, 29 Dec 2019 05:48:44 +0000 (00:48 -0500)
This reverts commit 22372ec49714bc36a869517ffc57a7be9e3a00ae.

(cherry picked from commit 50595c4ea8f660f9408c8c875a43aced0bd750b8)

fs/btrfs/ioctl.c

index 361fd14695b15f05da11538eac4d3d212e027daa..679303bf8e7414a828538aee793ad202047e34f3 100644 (file)
@@ -3239,7 +3239,7 @@ static void btrfs_double_extent_lock(struct inode *inode1, u64 loff1,
 static int btrfs_extent_same_range(struct inode *src, u64 loff, u64 olen,
                                   struct inode *dst, u64 dst_loff)
 {
-       const u64 bs = BTRFS_I(src)->root->fs_info->sb->s_blocksize;
+       u64 bs = BTRFS_I(src)->root->fs_info->sb->s_blocksize;
        int ret;
        u64 len = olen;
 
@@ -3261,7 +3261,7 @@ static int btrfs_extent_same_range(struct inode *src, u64 loff, u64 olen,
         * source range to serialize with relocation.
         */
        btrfs_double_extent_lock(src, loff, dst, dst_loff, len);
-       ret = btrfs_clone(src, dst, loff, len, ALIGN(len, bs), dst_loff, 1);
+       ret = btrfs_clone(src, dst, loff, olen, len, dst_loff, 1);
        btrfs_double_extent_unlock(src, loff, dst, dst_loff, len);
 
        return ret;