From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 343921FF13C for ; Thu, 05 Feb 2026 17:37:56 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 150A51684C; Thu, 5 Feb 2026 17:38:28 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [RFC storage 3/3] close #7204: lvm thin plugin: die if thin pool does not have zeroing configured Date: Thu, 5 Feb 2026 17:38:06 +0100 Message-ID: <20260205163819.219322-4-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260205163819.219322-1-f.ebner@proxmox.com> References: <20260205163819.219322-1-f.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1770309425400 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.017 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 Message-ID-Hash: RNZWDO77CDTMC5LZGFKX3COPAZ2AUUGP X-Message-ID-Hash: RNZWDO77CDTMC5LZGFKX3COPAZ2AUUGP 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: Thin pools with zeroing during allocation turned off are currently not supported for VM images. Using such a pool may lead to data corruption for various operations like drive mirror. In the future, a dedicated storage configuration option could be introduced that can be checked by volume_has_feature() and enforced upon storage activation. Signed-off-by: Fiona Ebner --- RFC - it is rather noisy since pvestatd will log it every time, OTOH it may cause data corruption so being noisy can be justified. An alternative might be to just automatically set it after detecting that the flag is missing and only warn once, mentioning that that this is done, but might be too much automagic. src/PVE/Storage/LvmThinPlugin.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/PVE/Storage/LvmThinPlugin.pm b/src/PVE/Storage/LvmThinPlugin.pm index 256ec43..dae40b6 100644 --- a/src/PVE/Storage/LvmThinPlugin.pm +++ b/src/PVE/Storage/LvmThinPlugin.pm @@ -6,6 +6,7 @@ use warnings; use IO::File; use PVE::JSONSchema qw(get_standard_option); +use PVE::RESTEnvironment qw(log_warn); use PVE::Tools qw(run_command trim); use PVE::Storage::Plugin; @@ -263,7 +264,21 @@ sub activate_storage { $class->SUPER::activate_storage($storeid, $scfg, $cache); - $activate_lv->($scfg->{vgname}, $scfg->{thinpool}, $cache); + my ($vg_name, $thin_pool) = $scfg->@{qw(vgname thinpool)}; + + $activate_lv->($vg_name, $thin_pool, $cache); + + if ($scfg->{content}->{images}) { + my $lvs = $cache->{lvs} ||= PVE::Storage::LVMPlugin::lvm_list_volumes(); + my $thin_pool_zero = $lvs->{$vg_name}->{$thin_pool}->{zero}; + if (!defined($thin_pool_zero) || $thin_pool_zero ne 'zero') { + # TODO Add dedicated storage configuration option to support thin pools without zero to + # allow cheap checking in volume_has_feature() and check that it matches here. + # TODO PVE 10 - enforce? + log_warn("$storeid: thin pool without zeroing is not supported for VM images!" + . " Use 'lvchange -Z y $vg_name/$thin_pool' to enable zeroing"); + } + } } sub activate_volume { -- 2.47.3