OSDN Git Service

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)
committerChris Mason <clm@fb.com>
Wed, 17 Sep 2014 20:38:35 +0000 (13:38 -0700)
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>
fs/btrfs/volumes.c

index f8273bb..1524b3f 100644 (file)
@@ -1671,11 +1671,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);