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

Commit 69611ac8 authored by Miao Xie's avatar Miao Xie Committed by Chris Mason
Browse files

Btrfs: fix unzeroed members in fs_devices when creating a fs from seed fs



We forgot to zero some members in fs_devices when we create new fs_devices
from the one of the seed fs. It would cause the problem that we got wrong
chunk profile when allocating chunks. Fix it.

Signed-off-by: default avatarMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 77bdae4d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1988,6 +1988,9 @@ static int btrfs_prepare_sprout(struct btrfs_root *root)
	fs_devices->seeding = 0;
	fs_devices->num_devices = 0;
	fs_devices->open_devices = 0;
	fs_devices->missing_devices = 0;
	fs_devices->num_can_discard = 0;
	fs_devices->rotating = 0;
	fs_devices->seed = seed_devices;

	generate_random_uuid(fs_devices->fsid);