btrfs: regression test for btrfs extent merge
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Mon, 10 Nov 2014 02:04:00 +0000 (13:04 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 10 Nov 2014 02:04:00 +0000 (13:04 +1100)
commit027bcfa64e40748a8999bad4b61b6f72215db522
tree2579c0c035d0870d88b4c091a3978ddd1abb1bce
parent8c7c07e79b72ec2b259aeb7c10e30891577a005b
btrfs: regression test for btrfs extent merge

The following kernel commit introduced the bug:
51f395ad btrfs: Use right extent length when inserting overlap extent map.

When btrfs commit race with btrfs_get_extent(), merge_extent_mapping()
may build up a new extent which length overflows and cause extent map
insert fail, causing the caller get a -EEXIST error.

This regression is fixed by the following patches:
btrfs: Fix and enhance merge_extent_mapping() to insert best fitted extent map
btrfs: Fix the wrong condition judgment about subset extent map

Cc: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Tested-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/btrfs/079 [new file with mode: 0755]
tests/btrfs/079.out [new file with mode: 0644]
tests/btrfs/group