all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Michael Köppl" <m.koeppl@proxmox.com>
To: "Lukas Sichert" <l.sichert@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH storage 1/2] fix #7339: lvmthick: add worker to free space of to be deleted VMs
Date: Mon, 23 Mar 2026 13:50:14 +0100	[thread overview]
Message-ID: <DHA6ARZ7YHRQ.1AA7T32WHLUIL@proxmox.com> (raw)
In-Reply-To: <20260323101506.56098-2-l.sichert@proxmox.com>

noticed one more thing here.

On Mon Mar 23, 2026 at 11:14 AM CET, Lukas Sichert wrote:
>      # lock shared storage
>      $plugin->cluster_lock_storage(
> @@ -1206,16 +1206,24 @@ sub vdisk_free {
>  
>              my (undef, undef, undef, undef, undef, $isBase, $format) =
>                  $plugin->parse_volname($volname);
> -            $cleanup_worker = $plugin->free_image($storeid, $scfg, $volname, $isBase, $format);
> +            $discard_worker = $plugin->free_image($storeid, $scfg, $volname, $isBase, $format);
>          },
>      );
>  
> -    return if !$cleanup_worker;
> +    return if !$discard_worker;
>  
>      my $rpcenv = PVE::RPCEnvironment::get();
>      my $authuser = $rpcenv->get_user();
>  
> -    $rpcenv->fork_worker('imgdel', undef, $authuser, $cleanup_worker);
> +    if ($scfg->{saferemove} && $scfg->{issue_blkdiscard}) {
> +        $rpcenv->fork_worker('diskzerodiscard', undef, $authuser, $discard_worker);
> +    } elsif ($scfg->{saferemove}) {
> +        $rpcenv->fork_worker('diskzero', undef, $authuser, $discard_worker); 
> +    } elsif ($scfg->{issue_blkdiscard}) {
> +        $rpcenv->fork_worker('diskdiscard', undef, $authuser, $discard_worker); 
> +    } else {
> +      die "config must have changed during execution. Disk can't be deleted safely";

This changes the current behavior in a way that affects other storage
plugins. vdisk_free is used for various storage types and this part kind
of assumes specifics of the LVM plugin (as in, for the LVM plugin it is
true that if the discard_workers is set, at least one of the fields
would have to be set) and will simply not fork a worker for any storage
plugin where this is not the case. From what I can see right now, this
discard worker is not returned for any of the other plugins (?), but
that might not always be the case. I think it'd make sense to still run
the 'imgdel' worker from before in the else case since the
discard_worker was obviously defined.

I'm also not sure about the error message. The storage config is only
read once at the beginning of the function. Even if it did change in the
meantime, you would not detect it here.

> +    }
>  }
>  
>  sub vdisk_list {
> diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm
> index 32a8339..b0b94a6 100644
> --- a/src/PVE/Storage/LVMPlugin.pm
> +++ b/src/PVE/Storage/LVMPlugin.pm
> @@ -352,12 +352,12 @@ my sub free_lvm_volumes {
>  
>      # we need to zero out LVM data for security reasons
>      # and to allow thin provisioning





  parent reply	other threads:[~2026-03-23 12:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 10:14 [PATCH manager/storage 0/2] fix #7339: lvmthick: add option to free storage for " Lukas Sichert
2026-03-23 10:14 ` [PATCH storage 1/2] fix #7339: lvmthick: add worker to free space of to be " Lukas Sichert
2026-03-23 10:31   ` Michael Köppl
2026-03-23 10:57   ` Maximiliano Sandoval
2026-03-23 12:50   ` Michael Köppl [this message]
2026-03-23 10:14 ` [PATCH manager 2/2] fix #7339: lvmthick: ui: add UI fields for option to free storage Lukas Sichert
2026-03-23 10:52   ` Maximiliano Sandoval
2026-03-23 14:01     ` Fabian Grünbichler
2026-03-23 12:39   ` Michael Köppl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DHA6ARZ7YHRQ.1AA7T32WHLUIL@proxmox.com \
    --to=m.koeppl@proxmox.com \
    --cc=l.sichert@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal