diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/send.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 591063dac0e6..84aed2f30aa2 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c | |||
@@ -3761,6 +3761,7 @@ static int send_write_or_clone(struct send_ctx *sctx, | |||
3761 | u64 len; | 3761 | u64 len; |
3762 | u32 l; | 3762 | u32 l; |
3763 | u8 type; | 3763 | u8 type; |
3764 | u64 bs = sctx->send_root->fs_info->sb->s_blocksize; | ||
3764 | 3765 | ||
3765 | ei = btrfs_item_ptr(path->nodes[0], path->slots[0], | 3766 | ei = btrfs_item_ptr(path->nodes[0], path->slots[0], |
3766 | struct btrfs_file_extent_item); | 3767 | struct btrfs_file_extent_item); |
@@ -3784,7 +3785,7 @@ static int send_write_or_clone(struct send_ctx *sctx, | |||
3784 | goto out; | 3785 | goto out; |
3785 | } | 3786 | } |
3786 | 3787 | ||
3787 | if (clone_root) { | 3788 | if (clone_root && IS_ALIGNED(offset + len, bs)) { |
3788 | ret = send_clone(sctx, offset, len, clone_root); | 3789 | ret = send_clone(sctx, offset, len, clone_root); |
3789 | } else if (sctx->flags & BTRFS_SEND_FLAG_NO_FILE_DATA) { | 3790 | } else if (sctx->flags & BTRFS_SEND_FLAG_NO_FILE_DATA) { |
3790 | ret = send_update_extent(sctx, offset, len); | 3791 | ret = send_update_extent(sctx, offset, len); |