From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 40804BFC29 for ; Tue, 9 Jan 2024 10:24:05 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1872C14FFA for ; Tue, 9 Jan 2024 10:23:35 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 9 Jan 2024 10:23:34 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 2FA5049027 for ; Tue, 9 Jan 2024 10:23:34 +0100 (CET) Date: Tue, 09 Jan 2024 10:23:26 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion , Stefan Hanreich References: <20231222095806.47673-1-s.hanreich@proxmox.com> In-Reply-To: MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1704792084.y7kfxyvj2i.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.064 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pve-devel] [PATCH pve-manager v4] postinst: filter rbds in lvm 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: , X-List-Received-Date: Tue, 09 Jan 2024 09:24:05 -0000 On December 29, 2023 1:41 pm, Friedrich Weber wrote: > I started testing this and will send a complete mail later, just wanted > to mention one thing I've stumbled upon. >=20 > Consider this pre-upgrade lvm.conf: >=20 > devices { > # added by pve-manager to avoid scanning ZFS zvols > global_filter=3D[ > "r|/dev/zd.*|"] > } >=20 > As `lvmconfig` normalizes the linebreak, SET_FILTER is 1 but apparently > the `sed` command produces a malformed config (I think it comments out > only the first line, but I didn't check). The validity check fails so > the pre-upgrade lvm.conf is restored, according to the logs: >=20 > '/etc/lvm/lvm.conf' -> '/etc/lvm/lvm.conf.bak' (backup: > '/etc/lvm/lvm.conf.bak~') > Setting 'global_filter' in /etc/lvm/lvm.conf to prevent zvols and rbds > from being scanned: > global_filter=3D"r|/dev/zd.*|" =3D> > global_filter=3D["r|/dev/zd.*|","r|/dev/rbd.*|"] > Parse error at byte 103604 (line 2307): unexpected token > Failed to load config file /etc/lvm/lvm.conf > Invalid LVM config detected - restoring from /etc/lvm/lvm.conf.bak > Setting up proxmox-ve (8.1.0) ... >=20 > This is quite the edge case. So I'm not sure if it worth the hassle to > change the logic to handle it properly (especially as the validity check > handles it somewhat gracefully)? IMHO this is okay, and the alternative would require basically re-implementing the LVM config parser and monitoring it for changes (e.g., quoting, comments, whitespace handling, ...) the error/warning is also clear enough w.r.t. what the intention is, so any user with a weirdly formatted config should be able to manually do the change if desired.