Skip to content

Commit

Permalink
Btrfs: Properly update right_nritems in push_leaf_left
Browse files Browse the repository at this point in the history
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: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Yan authored and Chris Mason committed Sep 25, 2008
1 parent 0e4de58 commit eef1c49
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1717,11 +1717,10 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
btrfs_item_nr_offset(push_items),
(btrfs_header_nritems(right) - push_items) *
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);

for (i = 0; i < right_nritems; i++) {
item = btrfs_item_nr(right, i);

Expand Down

0 comments on commit eef1c49

Please sign in to comment.