提交 6e3b9666 编写于 作者: Y Yan 提交者: Chris Mason

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: NChris Mason <chris.mason@oracle.com>
上级 f6dbff55
...@@ -481,8 +481,9 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans, ...@@ -481,8 +481,9 @@ 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;
continue;
} }
if (end < extent_end && end >= key.offset) { if (end < extent_end && end >= key.offset) {
if (found_extent) { if (found_extent) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册