]> git.hungrycats.org Git - linux/commitdiff
Btrfs: Fix wrong free_chunk_space assignment during removing a device
authorMiao Xie <miaox@cn.fujitsu.com>
Wed, 3 Sep 2014 13:35:35 +0000 (21:35 +0800)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Wed, 3 Dec 2014 15:16:46 +0000 (10:16 -0500)
During removing a device, we have modified free_chunk_space when we
shrink the device, so we needn't assign a new value to it after
the device shrink. Fix it.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit 5d778aaeb013bf819d00e33de7c673c04b5c4886)

fs/btrfs/volumes.c

index 62938cec7d3035440cbbc92ae511df7f085ddf5d..43ec093e3765a8234984bebc80ae9182a4300699 100644 (file)
@@ -1694,11 +1694,6 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
        if (ret)
                goto error_undo;
 
-       spin_lock(&root->fs_info->free_chunk_lock);
-       root->fs_info->free_chunk_space = device->total_bytes -
-               device->bytes_used;
-       spin_unlock(&root->fs_info->free_chunk_lock);
-
        device->in_fs_metadata = 0;
        btrfs_scrub_cancel_dev(root->fs_info, device);