]> git.ipfire.org Git - people/ms/linux.git/commitdiff
btrfs: Fix the wrong condition judgment about subset extent map
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Mon, 22 Sep 2014 01:13:03 +0000 (09:13 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Oct 2014 16:43:05 +0000 (09:43 -0700)
commit 32be3a1ac6d09576c57063c6c350ca36eaebdbd3 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: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/inode.c

index 1c1173e59adf2e1e40bdbd7862c8fb7d4e445cac..16454b6efc5556700d4b6eb99c2aacf3b53af71e 100644 (file)
@@ -6528,7 +6528,7 @@ insert:
                 * 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