diff options
author | Yan <yanzheng@21cn.com> | 2007-12-14 11:14:42 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:58 -0400 |
commit | 6e3b96668eb34da6060a5189e6a73e9d62a3b178 (patch) | |
tree | 6aba5e1e12c71eef597f5d11b6893ab381ef76e7 /fs/btrfs/file.c | |
parent | f6dbff55d77dee363c22873481db54d3bada3ea6 (diff) |
Off by one fix for btrfs_drop_extents
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>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 1cc4d285951c..a280b9562221 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -481,8 +481,9 @@ next_slot: | |||
481 | search_start = (extent_end + mask) & ~mask; | 481 | search_start = (extent_end + mask) & ~mask; |
482 | } else | 482 | } else |
483 | search_start = extent_end; | 483 | search_start = extent_end; |
484 | if (end < extent_end && start > key.offset && found_inline) { | 484 | if (end <= extent_end && start >= key.offset && found_inline) { |
485 | *hint_byte = EXTENT_MAP_INLINE; | 485 | *hint_byte = EXTENT_MAP_INLINE; |
486 | continue; | ||
486 | } | 487 | } |
487 | if (end < extent_end && end >= key.offset) { | 488 | if (end < extent_end && end >= key.offset) { |
488 | if (found_extent) { | 489 | if (found_extent) { |