Commit d20a3a26 authored by Qu Wenruo's avatar Qu Wenruo Committed by Greg Kroah-Hartman

btrfs: Fix the wrong condition judgment about subset extent map

commit 32be3a1a upstream.

Previous commit: btrfs: Fix and enhance merge_extent_mapping() to insert
best fitted extent map
is using wrong condition to judgement whether the range is a subset of a
existing extent map.

This may cause bug in btrfs no-holes mode.

This patch will correct the judgment and fix the bug.
Signed-off-by: default avatarQu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 985ee9f4
......@@ -6528,7 +6528,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
* extent causing the -EEXIST.
*/
if (start >= extent_map_end(existing) ||
start + len <= existing->start) {
start <= existing->start) {
/*
* The existing extent map is the one nearest to
* the [start, start + len) range which overlaps
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment