]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix file clone ioctl for bookend extents
authorChris Mason <chris.mason@oracle.com>
Fri, 9 Oct 2009 15:29:53 +0000 (11:29 -0400)
committerChris Mason <chris.mason@oracle.com>
Fri, 9 Oct 2009 15:29:53 +0000 (11:29 -0400)
commitdf4c9ce1f3e9c73f06ee5b2f67bc32fe5ebfbe49
tree8f0e073af940b1bdfb134b945a03a1b43b614352
parentcc9a18f42fb2c67e65f64860094f2d3104760328
Btrfs: fix file clone ioctl for bookend extents

The file clone ioctl was incorrectly taking the offset into the
extent on disk into account when calculating the length of the
cloned extent.

The length never changes based on the offset into the physical extent.

Test case:

fallocate -l 1g image
mke2fs image
bcp image image2
e2fsck -f image2

(errors on image2)

The math bug ends up wrapping the length of the extent, and things
go wrong from there.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/ioctl.c