diff options
author | Yan Zheng <zheng.yan@oracle.com> | 2008-12-17 10:21:48 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-12-17 10:21:48 -0500 |
commit | 87b29b208c6c38f3446d2de6ece946e2459052cf (patch) | |
tree | 43e717289e1e8446fced4093ab39667bba9ea60a /fs/btrfs/file-item.c | |
parent | d7f735d0bc68c411abda0a612e1421bdade649cc (diff) |
Btrfs: properly check free space for tree balancing
btrfs_insert_empty_items takes the space needed by the btrfs_item
structure into account when calculating the required free space.
So the tree balancing code shouldn't add sizeof(struct btrfs_item)
to the size when checking the free space. This patch removes these
superfluous additions.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r-- | fs/btrfs/file-item.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index 7acadf3b742a..cc6e0b6de949 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c | |||
@@ -300,6 +300,10 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end, | |||
300 | 300 | ||
301 | size = btrfs_item_size_nr(leaf, path->slots[0]); | 301 | size = btrfs_item_size_nr(leaf, path->slots[0]); |
302 | csum_end = key.offset + (size / csum_size) * root->sectorsize; | 302 | csum_end = key.offset + (size / csum_size) * root->sectorsize; |
303 | if (csum_end <= start) { | ||
304 | path->slots[0]++; | ||
305 | continue; | ||
306 | } | ||
303 | 307 | ||
304 | size = min(csum_end, end + 1) - start; | 308 | size = min(csum_end, end + 1) - start; |
305 | sums = kzalloc(btrfs_ordered_sum_size(root, size), GFP_NOFS); | 309 | sums = kzalloc(btrfs_ordered_sum_size(root, size), GFP_NOFS); |