diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-01-28 21:24:59 (GMT) |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-01-28 21:24:59 (GMT) |
commit | eab49bec41136460b12ac0fbeceeb88386d538c7 (patch) | |
tree | d2ad3e163407d7779d53fdaa0dedcc3b934106de /fs/btrfs/ioctl.c | |
parent | acce952b0263825da32cf10489413dec78053347 (diff) | |
parent | 4d728ec7aefdca5419d2ebfb28c147e81a4b59f4 (diff) | |
download | linux-fsl-qoriq-eab49bec41136460b12ac0fbeceeb88386d538c7.tar.xz |
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 a506a22..edd82be 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, memcpy(&new_key, &key, sizeof(new_key)); new_key.objectid = inode->i_ino; - new_key.offset = key.offset + destoff - off; + if (off <= key.offset) + new_key.offset = key.offset + destoff - off; + else + new_key.offset = destoff; trans = btrfs_start_transaction(root, 1); if (IS_ERR(trans)) { |