summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-09-21 16:00:27 -0400
committerChris Mason <chris.mason@oracle.com>2009-09-21 16:00:27 -0400
commit1fb58a6051cd904a9f8e0344b22e31921d6b5a4d (patch)
tree2f8c1a89b3e4f119590e89cebe1a5be1a02f487a /fs/btrfs
parent76dda93c6ae2c1dc3e6cde34569d6aca26b0c918 (diff)
downloadlinux-3.10-1fb58a6051cd904a9f8e0344b22e31921d6b5a4d.tar.gz
linux-3.10-1fb58a6051cd904a9f8e0344b22e31921d6b5a4d.tar.bz2
linux-3.10-1fb58a6051cd904a9f8e0344b22e31921d6b5a4d.zip
Btrfs: fix arithmetic error in clone ioctl
Fix an arithmetic error that was breaking extents cloned via the clone ioctl starting in the second half of a file. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ioctl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index a13fd556db7..a8577a7f26a 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1105,8 +1105,7 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd,
datao += off - key.offset;
datal -= off - key.offset;
}
- if (key.offset + datao + datal + key.offset >
- off + len)
+ if (key.offset + datao + datal > off + len)
datal = off + len - key.offset - datao;
/* disko == 0 means it's a hole */
if (!disko)