瀏覽代碼

Btrfs: Fix wrong free_chunk_space assignment during removing a device

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>
Miao Xie 11 年之前
父節點
當前提交
5d778aaeb0
共有 1 個文件被更改,包括 0 次插入5 次删除
  1. 0 5
      fs/btrfs/volumes.c

+ 0 - 5
fs/btrfs/volumes.c

@@ -1671,11 +1671,6 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
 	if (ret)
 	if (ret)
 		goto error_undo;
 		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;
 	device->in_fs_metadata = 0;
 	btrfs_scrub_cancel_dev(root->fs_info, device);
 	btrfs_scrub_cancel_dev(root->fs_info, device);