api: disks: create: re-check disk after fork/lock
Because then it might not be unused anymore. If there really is a race, this prevents e.g. sgdisk creating a partition on a device already in use by LVM or LVM destroying a partitioned device. For ZFS, also get the latest udev info once inside the worker. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
dcd8f3a3dd
commit
e99bc248d4
@ -154,6 +154,8 @@ __PACKAGE__->register_method ({
|
||||
|
||||
my $worker = sub {
|
||||
PVE::Diskmanage::locked_disk_action(sub {
|
||||
PVE::Diskmanage::assert_disk_unused($dev);
|
||||
|
||||
PVE::Storage::LVMPlugin::lvm_create_volume_group($dev, $name);
|
||||
|
||||
if ($param->{add_storage}) {
|
||||
|
||||
Reference in New Issue
Block a user