提交 f25956cc 编写于 作者: C Chris Mason

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: NChris Mason <chris.mason@oracle.com>
上级 23a07867
......@@ -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));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册