Fix EXTENT_MAP_INLINE off by one in btrfs_drop_extents
authorYan <yanzheng@21cn.com>
Tue, 6 Nov 2007 15:26:28 +0000 (10:26 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:03:57 +0000 (11:03 -0400)
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

index bb98f52f4ea4341af0013157275130c4745d654f..5ceaed25dce1cc2d5afc2ea572272ed1fbb8a70c 100644 (file)
@@ -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) {