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>