Off by one fix for btrfs_drop_extents
authorYan <yanzheng@21cn.com>
Fri, 14 Dec 2007 16:14:42 +0000 (11:14 -0500)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:03:58 +0000 (11:03 -0400)
One of my old patches introduces a new bug to
btrfs_drop_extents(changeset 275). Inline extents are not truncated
properly when "extent_end == end", it can trigger the BUG_ON at
file.c:600.  I hope I don't introduce new bug this time.

---

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/file.c

index 1cc4d285951ca6ee4883519a40930b71b386b83a..a280b9562221baaabaf9e7bca06967a7b3d9cb63 100644 (file)
@@ -481,8 +481,9 @@ 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;
+                       continue;
                }
                if (end < extent_end && end >= key.offset) {
                        if (found_extent) {
This page took 0.026594 seconds and 5 git commands to generate.