diff options
-rw-r--r-- | fs/btrfs/ioctl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 3419f5e72bf9..97b782ff92bb 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -3631,6 +3631,11 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | |||
3631 | if (off + len == src->i_size) | 3631 | if (off + len == src->i_size) |
3632 | len = ALIGN(src->i_size, bs) - off; | 3632 | len = ALIGN(src->i_size, bs) - off; |
3633 | 3633 | ||
3634 | if (len == 0) { | ||
3635 | ret = 0; | ||
3636 | goto out_unlock; | ||
3637 | } | ||
3638 | |||
3634 | /* verify the end result is block aligned */ | 3639 | /* verify the end result is block aligned */ |
3635 | if (!IS_ALIGNED(off, bs) || !IS_ALIGNED(off + len, bs) || | 3640 | if (!IS_ALIGNED(off, bs) || !IS_ALIGNED(off + len, bs) || |
3636 | !IS_ALIGNED(destoff, bs)) | 3641 | !IS_ALIGNED(destoff, bs)) |