[pve-devel] [PATCH container] fix #2820: block adding new volume with same id if it's pending delete

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Jul 1 08:57:50 CEST 2020


On 30.06.20 15:56, Oguz Bektas wrote:
> do a simple check to see if our $opt is already in the delete section.
>

When can this even happen? If a delete is pending the real property is still
in the config?
 
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
>  src/PVE/LXC/Config.pm | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
> index 0a28380..237e2e5 100644
> --- a/src/PVE/LXC/Config.pm
> +++ b/src/PVE/LXC/Config.pm
> @@ -974,6 +974,9 @@ sub update_pct_config {
>  	my $value = $param->{$opt};
>  	if ($opt =~ m/^mp(\d+)$/ || $opt eq 'rootfs') {
>  	    $class->check_protection($conf, "can't update CT $vmid drive '$opt'");
> +	    if ($conf->{pending}->{delete} =~ m/$opt/) {

so adding 'mp1' matches a pending delete for unrelated 'mp10 ??

> +		die "${opt} is in pending delete queue. please select another mountpoint ID\n";

Sentences start upper case after a full stop.

> +	    }
>  	    my $mp = $class->parse_volume($opt, $value);
>  	    $check_content_type->($mp) if ($mp->{type} eq 'volume');
>  	} elsif ($opt eq 'hookscript') {
> 





More information about the pve-devel mailing list