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 366AA1FF15C for ; Fri, 8 Aug 2025 22:07:24 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 65FA31FAB5; Fri, 8 Aug 2025 22:08:56 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Fri, 8 Aug 2025 22:04:34 +0200 Message-ID: <20250808200818.169456-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1754683677529 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.176 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 POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes 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 Subject: [pve-devel] [PATCH manager] d/postinst: lvm conf: automatically set correct default for thin_check_options 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" The Debian package for lvm was built without the THIN_CHECK_NEEDS_CHECK configure flag, leading to incompatible default thin_check_options with respect to the thin_check binary. The lvm.conf mentions that the defaults are > thin_check_options = [ "-q", "--clear-needs-check-flag" ] but an actual invocation of 'lvmconfig' will show that this is not the case: > # lvmconfig --typeconfig full global/thin_check_options > thin_check_options=["-q"] This leads to thin pools failing to activate when there are minor issues that the new version of thin_check can detect, which couldn't be detected earlier, because those issues will only be repaired when --clear-needs-check-flag (or --auto-repair) is present. If there is no override, explicitly set the default to the compatible value until the issue is fixed in the LVM package. If there is an override, check if the '--clear-needs-check-flag' option is present and tell the user to add it if not. Signed-off-by: Fiona Ebner --- If we go with this approach, might make sense to also add it to pve8to9 and the upgrade guide (although having it set only automatically makes removing it later easier). Alternative is to rebuild the LVM package ourselves with the correct build flags. debian/postinst | 71 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/debian/postinst b/debian/postinst index b6e07fd9..8568c5f0 100755 --- a/debian/postinst +++ b/debian/postinst @@ -8,9 +8,43 @@ set -e # conffile handling, and all the packages we depend of are already fully # installed and configured. +check_lvm_thin_check_options() { + # silence stderr to avoid message if there is no override + OLD_VALUE="$(lvmconfig --typeconfig diff global/thin_check_options 2> /dev/null || true)" + if test -z "$OLD_VALUE"; then + return 1 + fi + if echo "$OLD_VALUE" | grep -qv -- '--clear-needs-check-flag'; then + printf '\nNOTE: Detected override for thin_check_options without --clear-needs-check-flag option in /etc/lvm/lvm.conf\n' + printf 'Add the option to the override or thin pools with minor issues might not automatically activate anymore!\n\n' + else + echo "Good, '--clear-needs-check-flag' is already part of 'thin_check_options' in /etc/lvm/lvm.conf" + fi + return 0 +} + +set_lvm_thin_check_options() { + echo "Adding explicit thin_check_options setting to /etc/lvm/lvm.conf to allow thin pools with minor issues to be auto-repaired" + cat >> /etc/lvm/lvm.conf <