diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-01-28 16:24:59 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-01-28 16:24:59 -0500 |
commit | eab49bec41136460b12ac0fbeceeb88386d538c7 (patch) | |
tree | d2ad3e163407d7779d53fdaa0dedcc3b934106de /fs/btrfs/ioctl.c | |
parent | acce952b0263825da32cf10489413dec78053347 (diff) | |
parent | 4d728ec7aefdca5419d2ebfb28c147e81a4b59f4 (diff) |
Merge branch 'bug-fixes' of git://repo.or.cz/linux-btrfs-devel into btrfs-38
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index a506a22b522a..edd82becbb9e 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -1898,7 +1898,10 @@ static noinline long btrfs_ioctl_clone(struct file *file, unsigned long srcfd, | |||
1898 | 1898 | ||
1899 | memcpy(&new_key, &key, sizeof(new_key)); | 1899 | memcpy(&new_key, &key, sizeof(new_key)); |
1900 | new_key.objectid = inode->i_ino; | 1900 | new_key.objectid = inode->i_ino; |
1901 | new_key.offset = key.offset + destoff - off; | 1901 | if (off <= key.offset) |
1902 | new_key.offset = key.offset + destoff - off; | ||
1903 | else | ||
1904 | new_key.offset = destoff; | ||
1902 | 1905 | ||
1903 | trans = btrfs_start_transaction(root, 1); | 1906 | trans = btrfs_start_transaction(root, 1); |
1904 | if (IS_ERR(trans)) { | 1907 | if (IS_ERR(trans)) { |