all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Alexandre Derumier via pve-devel <pve-devel@lists.proxmox.com>
To: pve-devel@lists.proxmox.com
Cc: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Subject: [pve-devel] [PATCH v2 pve-storage 2/2] fix #6941 : lvmplugin : fix activation on secure delete
Date: Tue, 21 Oct 2025 16:00:54 +0200	[thread overview]
Message-ID: <mailman.162.1761055298.362.pve-devel@lists.proxmox.com> (raw)
In-Reply-To: <20251021140054.3916467-1-alexandre.derumier@groupe-cyllene.com>

[-- Attachment #1: Type: message/rfc822, Size: 5452 bytes --]

From: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH v2 pve-storage 2/2] fix #6941 : lvmplugin : fix activation on secure delete
Date: Tue, 21 Oct 2025 16:00:54 +0200
Message-ID: <20251021140054.3916467-3-alexandre.derumier@groupe-cyllene.com>

It was lost in the lvm qcow2 patches

Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
---
 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
         my $path = $class->path($scfg, $volname, $storeid);
         $path = "\@pve-$name" if $format && $format eq 'qcow2';
-        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



[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

  parent reply	other threads:[~2025-10-21 14:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20251021140054.3916467-1-alexandre.derumier@groupe-cyllene.com>
2025-10-21 14:00 ` [pve-devel] [PATCH v2 pve-storage 1/2] lvmplugin: use blkdiscard when supported instead cstream to saferemove drive Alexandre Derumier via pve-devel
2025-10-22  8:22   ` Fiona Ebner
2025-10-22  9:35     ` DERUMIER, Alexandre via pve-devel
     [not found]     ` <414f3fba72876b4138458b625275892e059378af.camel@groupe-cyllene.com>
2025-10-22  9:43       ` Fiona Ebner
2025-10-21 14:00 ` Alexandre Derumier via pve-devel [this message]
2025-10-22  9:12   ` [pve-devel] [PATCH v2 pve-storage 2/2] fix #6941 : lvmplugin : fix activation on secure delete Fiona Ebner
2025-10-22  9:35     ` Fiona Ebner

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=mailman.162.1761055298.362.pve-devel@lists.proxmox.com \
    --to=pve-devel@lists.proxmox.com \
    --cc=alexandre.derumier@groupe-cyllene.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