diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a990a904513929d8e735ba00d3f120dbed975f6c..ed3ba55f65ac1802997bf3d219da913d3cb2b3f6 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -3488,6 +3488,8 @@ static int btrfs_extent_same_range(struct inode *src, u64 loff, u64 olen, const u64 sz = BTRFS_I(src)->root->fs_info->sectorsize; len = round_down(i_size_read(src), sz) - loff; + if (len == 0) + return 0; olen = len; } }