aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-09-12 15:32:53 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:07 -0400
commitf25956cc582f5954033cca3f9488c0a5d5193541 (patch)
tree0ade2c55ef8283931f947199447f7aff454c9b57 /fs
parent23a07867b78ee0f33b01466e52bb608c336b26ee (diff)
Fix leaf overflow check in btrfs_insert_empty_items
It was incorrectly adding an extra sizeof(struct btrfs_item) and causing false positives (oops) Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ctree.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index ab07557bac07..18e84472abb5 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2737,8 +2737,7 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans,
2737 nritems = btrfs_header_nritems(leaf); 2737 nritems = btrfs_header_nritems(leaf);
2738 data_end = leaf_data_end(root, leaf); 2738 data_end = leaf_data_end(root, leaf);
2739 2739
2740 if (btrfs_leaf_free_space(root, leaf) < 2740 if (btrfs_leaf_free_space(root, leaf) < total_size) {
2741 sizeof(struct btrfs_item) + total_size) {
2742 btrfs_print_leaf(root, leaf); 2741 btrfs_print_leaf(root, leaf);
2743 printk("not enough freespace need %u have %d\n", 2742 printk("not enough freespace need %u have %d\n",
2744 total_size, btrfs_leaf_free_space(root, leaf)); 2743 total_size, btrfs_leaf_free_space(root, leaf));