From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 2B0371FF0E5 for ; Wed, 15 Jul 2026 12:26:06 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B84A62143D; Wed, 15 Jul 2026 12:26:05 +0200 (CEST) Message-ID: <4e795a64-ab0a-4f7f-a706-7a83e0edfede@proxmox.com> Date: Wed, 15 Jul 2026 12:26:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH storage v9 1/5] lvm: saferemove: keep LVs where zero-out failed for manual zero-out To: Lukas Sichert , pve-devel@lists.proxmox.com References: <20260713160008.121125-1-l.sichert@proxmox.com> <20260713160008.121125-2-l.sichert@proxmox.com> Content-Language: en-US From: Fiona Ebner In-Reply-To: <20260713160008.121125-2-l.sichert@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784111143912 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.261 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust 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: MNB6QUAZNUYNOB55AW3IAAKRAQJVEMJE X-Message-ID-Hash: MNB6QUAZNUYNOB55AW3IAAKRAQJVEMJE X-MailFrom: f.ebner@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: Am 13.07.26 um 6:00 PM schrieb Lukas Sichert: > Currently even if 'zeroout' fails, the LV is removed and can't be zeroed > out manually later. > > Let zeroing errors propagate from the secure delete command, and rename > failed removals to a 'failed--del-*' LV name instead of immediately > removing them. > > Signed-off-by: Lukas Sichert Reviewed-by: Fiona Ebner with two nits ^^ > @@ -279,6 +282,44 @@ sub lvm_list_volumes { > return $lvs; > } > > +my sub cleanup_failed_lvm_volume { Nit: The name could be a bit more telling about what it actually does, maybe rename_after_failed_{cleanup,delete}()? > @@ -368,18 +411,33 @@ my sub free_lvm_volumes_locked { > errmsg => "can't refresh LV '$lvmpath' to zero-out its data", > ); > > - $secure_delete_cmd->($lvmpath); > + eval { $secure_delete_cmd->($lvmpath); }; > + if (my $cleanup_err = $@) { > + my $failed_name = > + eval { cleanup_failed_lvm_volume($class, $scfg, $storeid, $vg, $name) }; > + if (my $cleanup_failed_err = $@) { > + log_warn( > + "rename failed for '$vg/del-$name' to failed cleanup volume:" Nit: I'd go with something like "unable to rename '$vg/del-$name' after failed cleanup:" This makes it clear that the warning happens after the cleanup error even though it shows up before that in the log. > + . " $cleanup_failed_err", > + ); > + die "cleanup failed for lv $name: $cleanup_err\n"; > + } >