Commit 2f29df4f authored by Hans van Kranenburg's avatar Hans van Kranenburg Committed by David Sterba

btrfs: alloc_chunk: do not refurbish num_bytes

The variable num_bytes is used to store the chunk length of the chunk
that we're allocating. Do not reuse it for something really different in
the same function.
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarHans van Kranenburg <hans.van.kranenburg@mendix.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 3cd24c69
...@@ -4869,10 +4869,9 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans, ...@@ -4869,10 +4869,9 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
if (ret) if (ret)
goto error_del_extent; goto error_del_extent;
for (i = 0; i < map->num_stripes; i++) { for (i = 0; i < map->num_stripes; i++)
num_bytes = map->stripes[i].dev->bytes_used + stripe_size; btrfs_device_set_bytes_used(map->stripes[i].dev,
btrfs_device_set_bytes_used(map->stripes[i].dev, num_bytes); map->stripes[i].dev->bytes_used + stripe_size);
}
atomic64_sub(stripe_size * map->num_stripes, &info->free_chunk_space); atomic64_sub(stripe_size * map->num_stripes, &info->free_chunk_space);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment