diff options
author | Hans van Kranenburg <hans.van.kranenburg@mendix.com> | 2018-10-04 17:24:38 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-12-17 08:51:33 -0500 |
commit | 2f29df4fc24ee3467f0073300d93a55499c7dd9f (patch) | |
tree | ad97ce2d8726c3cdbeef04bc0a2e91ddf0cd2bdd /fs/btrfs | |
parent | 3cd24c698004d2f7668e0eb9fc1f096f533c791b (diff) |
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: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/volumes.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index bb76263c3ad4..405d8977a2b5 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -4869,10 +4869,9 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans, | |||
4869 | if (ret) | 4869 | if (ret) |
4870 | goto error_del_extent; | 4870 | goto error_del_extent; |
4871 | 4871 | ||
4872 | for (i = 0; i < map->num_stripes; i++) { | 4872 | for (i = 0; i < map->num_stripes; i++) |
4873 | num_bytes = map->stripes[i].dev->bytes_used + stripe_size; | 4873 | btrfs_device_set_bytes_used(map->stripes[i].dev, |
4874 | btrfs_device_set_bytes_used(map->stripes[i].dev, num_bytes); | 4874 | map->stripes[i].dev->bytes_used + stripe_size); |
4875 | } | ||
4876 | 4875 | ||
4877 | atomic64_sub(stripe_size * map->num_stripes, &info->free_chunk_space); | 4876 | atomic64_sub(stripe_size * map->num_stripes, &info->free_chunk_space); |
4878 | 4877 | ||