It was incorrectly adding an extra sizeof(struct btrfs_item) and causing
false positives (oops)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
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));