Daniel J Blueman
2010-Jul-23 22:46 UTC
[2.6.35-rc6 patch] correct item insert accounting...
Hi Chris, It looks like this was the intent - if not, perhaps drop the redundant ''nr = i'' assignment? --- Limit the number of items to insert (nr) to the available space in the BTRFS leaf as intended. Signed-off-by: Daniel J Blueman <daniel.blueman@gmail.com> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index c3df14c..fb7e20d 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -3544,8 +3544,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); -- Daniel J Blueman -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html