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 CBC521FF141 for ; Tue, 30 Jun 2026 14:20:44 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id DF07621419; Tue, 30 Jun 2026 14:20:42 +0200 (CEST) Message-ID: Date: Tue, 30 Jun 2026 14:20:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH storage v7 2/4] fix #7339: lvm: add discard action for removed volumes From: Fiona Ebner To: Lukas Sichert , pve-devel@lists.proxmox.com References: <20260616101323.24981-1-l.sichert@proxmox.com> <20260616101323.24981-3-l.sichert@proxmox.com> <777e92d5-3d3e-4daf-8e2b-2061d931ef4e@proxmox.com> Content-Language: en-US In-Reply-To: <777e92d5-3d3e-4daf-8e2b-2061d931ef4e@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: 1782821995873 X-SPAM-LEVEL: Spam detection results: 0 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) 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: MBV3GBK2COU5RELNNM3J5NSRL7QLWCIS X-Message-ID-Hash: MBV3GBK2COU5RELNNM3J5NSRL7QLWCIS 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 30.06.26 um 2:15 PM schrieb Fiona Ebner: > Am 16.06.26 um 12:13 PM schrieb Lukas Sichert: >> @@ -373,6 +381,14 @@ my sub free_lvm_volumes_locked { >> die "short syswrite: wrote $written of $stepsize bytes\n"; >> } >> } >> + if ($on_remove_opts->{discard}) { >> + eval { >> + blockdev_ioctl_range($fh, 'BLKDISCARD', BLKDISCARD, $offset, $stepsize); >> + }; >> + if ($@) { >> + log_warn("blkdiscard failed: $@"); > > Similar to the last patch, I would log the offset and length for > completeness. I also wonder if we should Oh, and I wonder if we should really log it for every failure independently. Maybe just the first one and then count and log how many operations failed in total? Depending on the scenario, it might be a huge number of messages. Together with checking for actual support first like Michael suggested.