e46472
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
e46472
Date: Mon, 22 Sep 2014 09:13:03 +0800
e46472
Subject: [PATCH] btrfs: Fix the wrong condition judgment about subset extent
e46472
 map
e46472
e46472
(cherry picked from commit 32be3a1ac6d09576c57063c6c350ca36eaebdbd3)
e46472
e46472
Previous commit: btrfs: Fix and enhance merge_extent_mapping() to insert
e46472
best fitted extent map
e46472
is using wrong condition to judgement whether the range is a subset of a
e46472
existing extent map.
e46472
e46472
This may cause bug in btrfs no-holes mode.
e46472
e46472
This patch will correct the judgment and fix the bug.
e46472
e46472
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
e46472
Signed-off-by: Chris Mason <clm@fb.com>
e46472
---
e46472
 fs/btrfs/inode.c | 2 +-
e46472
 1 file changed, 1 insertion(+), 1 deletion(-)
e46472
e46472
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
e46472
index 1c1173e59adf..16454b6efc55 100644
e46472
--- a/fs/btrfs/inode.c
e46472
+++ b/fs/btrfs/inode.c
e46472
@@ -6528,7 +6528,7 @@ insert:
e46472
 		 * extent causing the -EEXIST.
e46472
 		 */
e46472
 		if (start >= extent_map_end(existing) ||
e46472
-		    start + len <= existing->start) {
e46472
+		    start <= existing->start) {
e46472
 			/*
e46472
 			 * The existing extent map is the one nearest to
e46472
 			 * the [start, start + len) range which overlaps
e46472
-- 
e46472
1.9.3
e46472