Commit eef1c494 authored by Yan's avatar Yan Committed by Chris Mason

Btrfs: Properly update right_nritems in push_leaf_left

The codes that fixup the right leaf and the codes that dirty the
extnet buffer use the variable 'right_nritems' ,  both of them expect
'right_nritems' is the number of items in right leaf after the push.
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 0e4de584
...@@ -1717,11 +1717,10 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root ...@@ -1717,11 +1717,10 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_item_nr_offset(push_items), btrfs_item_nr_offset(push_items),
(btrfs_header_nritems(right) - push_items) * (btrfs_header_nritems(right) - push_items) *
sizeof(struct btrfs_item)); sizeof(struct btrfs_item));
} }
btrfs_set_header_nritems(right, right_nritems - push_items); right_nritems -= push_items;
btrfs_set_header_nritems(right, right_nritems);
push_space = BTRFS_LEAF_DATA_SIZE(root); push_space = BTRFS_LEAF_DATA_SIZE(root);
for (i = 0; i < right_nritems; i++) { for (i = 0; i < right_nritems; i++) {
item = btrfs_item_nr(right, i); item = btrfs_item_nr(right, i);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment