From a273208edd55463b3bcd8b77a6fe8ba54afc6940 Mon Sep 17 00:00:00 2001
From: Yan <yanzheng@21cn.com>
Date: Tue, 6 Nov 2007 10:26:28 -0500
Subject: [PATCH] Fix EXTENT_MAP_INLINE off by one in btrfs_drop_extents

Don't set hint_byte to EXTENT_MAP_INLINE when 'end == extent_end' or
'start == key.offset' . The inline extent will be truncated in these
cases.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
---
 fs/btrfs/file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index bb98f52f4ea43..5ceaed25dce1c 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -475,8 +475,7 @@ next_slot:
 			search_start = (extent_end + mask) & ~mask;
 		} else
 			search_start = extent_end;
-
-		if (end <= extent_end && start >= key.offset && found_inline) {
+		if (end < extent_end && start > key.offset && found_inline) {
 			*hint_byte = EXTENT_MAP_INLINE;
 		}
 		if (end < extent_end && end >= key.offset) {
-- 
2.30.2