]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: fix a crash of clone with inline extents's split
authorLiu Bo <bo.li.liu@oracle.com>
Mon, 10 Mar 2014 10:56:07 +0000 (18:56 +0800)
committerChris Mason <clm@fb.com>
Sat, 22 Mar 2014 00:35:18 +0000 (17:35 -0700)
commit67b8c7d3f471399aa1713fc77695486a44d5bc6f
tree968425a22d4ccb20cdd2f9878083e0258d09d857
parent65c394d0352a2d795598567f023a8251a6405ff0
Btrfs: fix a crash of clone with inline extents's split

xfstests's btrfs/035 triggers a BUG_ON, which we use to detect the split
of inline extents in __btrfs_drop_extents().

For inline extents, we cannot duplicate another EXTENT_DATA item, because
it breaks the rule of inline extents, that is, 'start offset' needs to be 0.

We have set limitations for the source inode's compressed inline extents,
because it needs to decompress and recompress.  Now the destination inode's
inline extents also need similar limitations.

With this, xfstests btrfs/035 doesn't run into panic.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/file.c
fs/btrfs/ioctl.c