diff options
author | Yan <yanzheng@21cn.com> | 2008-01-30 14:39:54 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:00 -0400 |
commit | 0181e58f91c1edbf835edb7a87d6dfe81374709d (patch) | |
tree | 6c54b29a535e684e22eb73e0a5077c19effedc75 | |
parent | 1b0f7c29e2f4f41e1367e7581d3a9c8c70f0394a (diff) | |
download | linux-3.10-0181e58f91c1edbf835edb7a87d6dfe81374709d.tar.gz linux-3.10-0181e58f91c1edbf835edb7a87d6dfe81374709d.tar.bz2 linux-3.10-0181e58f91c1edbf835edb7a87d6dfe81374709d.zip |
btrfs_drop_extent fixe for inline items > 8K
When truncating a inline extent, btrfs_drop_extents doesn't properly
handle the case "key.offset > inline_limit". This bug can only happen
when max line size is larger than 8K.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r-- | fs/btrfs/file.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 7c10a90362f..7cbf8d8d7e2 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -591,8 +591,7 @@ next_slot: } } bookend = 1; - if (found_inline && start <= key.offset && - inline_limit < extent_end) + if (found_inline && start <= key.offset) keep = 1; } /* truncate existing extent */ @@ -672,11 +671,10 @@ next_slot: if (!bookend) continue; } - if (bookend && found_inline && start <= key.offset && - inline_limit < extent_end && key.offset <= inline_limit) { + if (bookend && found_inline && start <= key.offset) { u32 new_size; new_size = btrfs_file_extent_calc_inline_size( - extent_end - inline_limit); + extent_end - end); btrfs_truncate_item(trans, root, path, new_size, 0); } /* create bookend, splitting the extent in two */ |