diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-09-12 15:32:53 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:07 -0400 |
commit | f25956cc582f5954033cca3f9488c0a5d5193541 (patch) | |
tree | 0ade2c55ef8283931f947199447f7aff454c9b57 /fs/btrfs/ctree.c | |
parent | 23a07867b78ee0f33b01466e52bb608c336b26ee (diff) | |
download | blackbird-op-linux-f25956cc582f5954033cca3f9488c0a5d5193541.tar.gz blackbird-op-linux-f25956cc582f5954033cca3f9488c0a5d5193541.zip |
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/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 3 |
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, nritems = btrfs_header_nritems(leaf); data_end = leaf_data_end(root, leaf); - if (btrfs_leaf_free_space(root, leaf) < - sizeof(struct btrfs_item) + total_size) { + if (btrfs_leaf_free_space(root, leaf) < total_size) { btrfs_print_leaf(root, leaf); printk("not enough freespace need %u have %d\n", total_size, btrfs_leaf_free_space(root, leaf)); |