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 <[email protected]> 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
