]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: Fix file clone when source offset is not 0
authorLi Zefan <lizf@cn.fujitsu.com>
Wed, 26 Jan 2011 06:10:43 +0000 (14:10 +0800)
committerLi Zefan <lizf@cn.fujitsu.com>
Wed, 26 Jan 2011 17:11:18 +0000 (01:11 +0800)
commit980b0679ba80fcc3e202f00db93d19a666f4ad1a
tree19dc56836d053c04d796ddca126dd60232175bb0
parenta2e3515451914efc818ab5a1446cb480eaa4fe0c
Btrfs: Fix file clone when source offset is not 0

Suppose:
- the source extent is: [0, 100]
- the src offset is 10
- the clone length is 90
- the dest offset is 0

This statement:

new_key.offset = key.offset + destoff - off

will produce such an extent for the dest file:

[ino, BTRFS_EXTENT_DATA_KEY, -10]

, which is obviously wrong.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
fs/btrfs/ioctl.c