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 5F08F1FF183 for ; Wed, 22 Oct 2025 11:12:36 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7741512156; Wed, 22 Oct 2025 11:13:00 +0200 (CEST) Message-ID: Date: Wed, 22 Oct 2025 11:12:56 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox VE development discussion References: <20251021140054.3916467-1-alexandre.derumier@groupe-cyllene.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761124369794 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.020 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lvmplugin.pm] Subject: Re: [pve-devel] [PATCH v2 pve-storage 2/2] fix #6941 : lvmplugin : fix activation on secure delete X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 21.10.25 um 4:01 PM schrieb Alexandre Derumier via pve-devel: > It was lost in the lvm qcow2 patches This commit message is very unspecific. Should at least mention what the issue is/that this affects raw volumes. When referring to an older commit, please include the short commit ID and title. > Signed-off-by: Alexandre Derumier I like the approach of moving activation closer to where actually needed :) Some comments inline: > --- > src/PVE/Storage/LVMPlugin.pm | 24 ++++++++++++------------ > 1 file changed, 12 insertions(+), 12 deletions(-) > > diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm > index 1c633a3..9716854 100644 > --- a/src/PVE/Storage/LVMPlugin.pm > +++ b/src/PVE/Storage/LVMPlugin.pm > @@ -375,6 +375,17 @@ my sub free_lvm_volumes { > my $lvmpath = "/dev/$vg/del-$name"; > print "zero-out data on image $name ($lvmpath)\n"; > > + my $cmd_activate = ['/sbin/lvchange', '-aly', $lvmpath]; > + run_command( > + $cmd_activate, > + errmsg => "can't activate LV '$lvmpath' to zero-out its data", > + ); > + $cmd_activate = ['/sbin/lvchange', '--refresh', $lvmpath]; > + run_command( > + $cmd_activate, > + errmsg => "can't refresh LV '$lvmpath' to zero-out its data", > + ); > + > $secure_delete_cmd->($lvmpath); > > $class->cluster_lock_storage( > @@ -755,13 +766,6 @@ my sub alloc_snap_image { > my sub free_snap_image { > my ($class, $storeid, $scfg, $volname, $snap) = @_; > > - #activate only the snapshot volume > - my $path = $class->path($scfg, $volname, $storeid, $snap); > - my $cmd = ['/sbin/lvchange', '-aly', $path]; > - run_command($cmd, errmsg => "can't activate LV '$path' to zero-out its data"); > - $cmd = ['/sbin/lvchange', '--refresh', $path]; > - run_command($cmd, errmsg => "can't refresh LV '$path' to zero-out its data"); > - > my $snap_volname = get_snap_name($class, $volname, $snap); > return free_lvm_volumes($class, $scfg, $storeid, [$snap_volname]); > } > @@ -777,11 +781,7 @@ sub free_image { > #activate volumes && snapshot volumes This comment is misleading now. It should note that snapshots are activated later in free_lvm_volumes() if needed for zeroing. > my $path = $class->path($scfg, $volname, $storeid); > $path = "\@pve-$name" if $format && $format eq 'qcow2'; The $path variable is not used anymore and can be dropped. On another note, the way of using tags like "@pve-vm-105-disk-2.qcow2" is not quite correct, because there might be multiple LVM storages with qcow2 and volumes with the same name. And those then should not be tagged the same, but currently are. While it's probably very rare to come across such a setup, it's not impossible and could lead to hard-to-debug issues down the line. But it's out of scope for the current series. > - my $cmd = ['/sbin/lvchange', '-aly', $path]; > - run_command($cmd, errmsg => "can't activate LV '$path' to zero-out its data"); > - $cmd = ['/sbin/lvchange', '--refresh', $path]; > - run_command($cmd, errmsg => "can't refresh LV '$path' to zero-out its data"); > - > + $class->activate_volume($storeid, $scfg, $volname); > my $snapshots = $class->volume_snapshot_info($scfg, $storeid, $volname); > for my $snapid ( > sort { $snapshots->{$a}->{order} <=> $snapshots->{$b}->{order} } > -- > 2.47.3 > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel