Commit a273208e authored by Yan's avatar Yan Committed by Chris Mason

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: default avatarChris Mason <chris.mason@oracle.com>
parent dcfec0dc
...@@ -475,8 +475,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, ...@@ -475,8 +475,7 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans,
search_start = (extent_end + mask) & ~mask; search_start = (extent_end + mask) & ~mask;
} else } else
search_start = extent_end; 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; *hint_byte = EXTENT_MAP_INLINE;
} }
if (end < extent_end && end >= key.offset) { if (end < extent_end && end >= key.offset) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment