Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d778aae authored by Miao Xie's avatar Miao Xie Committed by Chris Mason
Browse files

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: default avatarMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent ce7213c7
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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);