Skip to content

Commit

Permalink
Fix EXTENT_MAP_INLINE off by one in btrfs_drop_extents
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yan authored and Chris Mason committed Sep 25, 2008
1 parent dcfec0d commit a273208
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans,
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) {
Expand Down

0 comments on commit a273208

Please sign in to comment.