[02/10] btrfs: fix break phase in btrfs_insert_some_items()
diff mbox

Message ID 4BF4E167.9070201@cn.fujitsu.com
State New, archived
Headers show

Commit Message

Miao Xie May 20, 2010, 7:14 a.m. UTC
None

Patch
diff mbox

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index babf7fb..7adff4e 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -3430,8 +3430,8 @@  int btrfs_insert_some_items(struct btrfs_trans_handle *trans,
 	for (i = 0; i < nr; i++) {
 		if (total_size + data_size[i] + sizeof(struct btrfs_item) >
 		    BTRFS_LEAF_DATA_SIZE(root)) {
-			break;
 			nr = i;
+			break;
 		}
 		total_data += data_size[i];
 		total_size += data_size[i] + sizeof(struct btrfs_item);