diff options
-rw-r--r-- | fs/btrfs/ioctl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index e8795becad4c..cdbb054102b9 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -1123,8 +1123,10 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | |||
1123 | datao += off - key.offset; | 1123 | datao += off - key.offset; |
1124 | datal -= off - key.offset; | 1124 | datal -= off - key.offset; |
1125 | } | 1125 | } |
1126 | if (key.offset + datao + datal > off + len) | 1126 | |
1127 | datal = off + len - key.offset - datao; | 1127 | if (key.offset + datal > off + len) |
1128 | datal = off + len - key.offset; | ||
1129 | |||
1128 | /* disko == 0 means it's a hole */ | 1130 | /* disko == 0 means it's a hole */ |
1129 | if (!disko) | 1131 | if (!disko) |
1130 | datao = 0; | 1132 | datao = 0; |