[Btrfs-devel][PATCH]Properly update right_nritems in push_leaf_left

Yan Zheng yanzheng at 21cn.com
Mon Nov 26 00:45:50 PST 2007


Hello,

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.

Regards
YZ
---
diff -r 66ea50b1a761 ctree.c
--- a/ctree.c	Tue Nov 20 13:44:45 2007 -0500
+++ b/ctree.c	Mon Nov 26 16:35:28 2007 +0800
@@ -1719,7 +1719,8 @@ static int push_leaf_left(struct btrfs_t
 			     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++) {



More information about the Btrfs-devel mailing list