From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id D76E51FF13B for ; Wed, 06 May 2026 12:00:14 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 82D071C211; Wed, 6 May 2026 12:00:14 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 06 May 2026 11:59:37 +0200 Message-Id: Subject: Re: [PATCH storage v3 1/2] fix #7339: lvmthick: add worker to free space of to be deleted VMs From: "Lukas Sichert" To: "Friedrich Weber" , References: <20260423144721.54451-1-l.sichert@proxmox.com> <20260423144721.54451-2-l.sichert@proxmox.com> <24d217bf-5b9f-48d2-8754-9614bbbc5484@proxmox.com> In-Reply-To: <24d217bf-5b9f-48d2-8754-9614bbbc5484@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778061470057 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.595 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: Y5HAQOKMJPXUSM3JRGYQQI22SJZUQJ42 X-Message-ID-Hash: Y5HAQOKMJPXUSM3JRGYQQI22SJZUQJ42 X-MailFrom: l.sichert@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 2026-05-05 17:59, Friedrich Weber wrote: >> diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm >> index 6e87bac..ef1596f 100755 >> --- a/src/PVE/Storage.pm >> +++ b/src/PVE/Storage.pm >> @@ -1192,7 +1192,7 @@ sub vdisk_free { >> =20 >> activate_storage($cfg, $storeid); >> =20 >> - my $cleanup_worker; >> + my $discard_worker; >> =20 >> # lock shared storage >> $plugin->cluster_lock_storage( >> @@ -1206,16 +1206,24 @@ sub vdisk_free { >> =20 >> my (undef, undef, undef, undef, undef, $isBase, $format) = =3D >> $plugin->parse_volname($volname); >> - $cleanup_worker =3D $plugin->free_image($storeid, $scfg, $v= olname, $isBase, $format); >> + $discard_worker =3D $plugin->free_image($storeid, $scfg, $v= olname, $isBase, $format); >> }, >> ); >> =20 >> - return if !$cleanup_worker; >> + return if !$discard_worker; >> =20 >> my $rpcenv =3D PVE::RPCEnvironment::get(); >> my $authuser =3D $rpcenv->get_user(); >> =20 >> - $rpcenv->fork_worker('imgdel', undef, $authuser, $cleanup_worker); >> + if ($scfg->{saferemove} && $scfg->{'issue-blkdiscard'}) { >> + $rpcenv->fork_worker('diskzerodiscard', undef, $authuser, $disc= ard_worker); >> + } elsif ($scfg->{saferemove}) { >> + $rpcenv->fork_worker('diskzero', undef, $authuser, $discard_wor= ker); >> + } elsif ($scfg->{'issue-blkdiscard'}) { >> + $rpcenv->fork_worker('diskdiscard', undef, $authuser, $discard_= worker); >> + } else { >> + $rpcenv->fork_worker('imgdel', undef, $authuser, $discard_worke= r); >> + } >> } > > Is this change necessary? To me it seems like the fairly general > PVE::Storage::vdisk_free shouldn't check for plugin-specific config > options (like saferemove/issue-blkdiscard) -- in a way, it breaks the > abstraction provided by PVE::Storage. Wouldn't it be nicer to keep > PVE::Storage::vdisk_free as-is, have it spawn the dedicated 'imgdel' > task, and the 'imgdel' task returned by the LVM plugin then > zeroouts+discards/only-zeroouts/only-discards depending on the LVM > storage settings? This patch is there to improve the worker description displayed in the task log. An 'imgdel' worker is currently displayed as an 'Erase data' task. This can be misleading if 'saferemove' is not enabled, as no data is actually erased. With these changes, the description for 'saferemove' enabled becomes 'Zero out disk', for 'issue-blkdiscard' enabled it becomes 'Discard disk', and for both enabled it becomes 'Zero out and discard disk'. That said, this is also suboptimal because if other plugins return worker tasks from their '$free_image' implementations, then their descriptions could also be altered if these flags are set. In the default Proxmox stack this is currently not the case, but it could affect external plugins. Another option would be to rename the displayed name for an 'imgdel' task in the UI to 'Destroy image'. That would fit the generic worker task better and would also make the naming consistent with 'unknownimgdel', which is currently displayed as 'Destroy image from unknown guest'. Does anybody have opinions on how to go forward with this? Thanks in advance!