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 1F2956BAC5 for ; Fri, 19 Feb 2021 13:46:59 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1550218C83 for ; Fri, 19 Feb 2021 13:46:29 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (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 firstgate.proxmox.com (Proxmox) with ESMTPS id 879F518C5D for ; Fri, 19 Feb 2021 13:46:27 +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 48E1046288 for ; Fri, 19 Feb 2021 13:46:27 +0100 (CET) From: Stoiko Ivanov To: pve-devel@lists.proxmox.com Date: Fri, 19 Feb 2021 13:45:41 +0100 Message-Id: <20210219124544.12593-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.063 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [zfspoolplugin.pm] Subject: [pve-devel] [PATCH storage v2 0/3] zfspoolplugin: check if mounted instead of imported 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: Fri, 19 Feb 2021 12:46:59 -0000 v1->v2: after a short talk off-list with Thomas (Thanks!), we decided to parse /proc/mounts to check if the pool is properly imported and mounted: * it catches a few corner cases (root-dataset having canmount set to off) * since zfs mount -a traverses the dataset in-order - so it should not cause a false-detection (which would have been caught by running zfs get mounted on the root-dataset only) * it is quite a bit faster * separated the cleanup from the actual patch * tried to structure the patches a bit more (feel free to squash 2/3 and 3/3) original note for v1: rfc -> v1: * incorporated Thomas' feedback (Thanks): ** we now check both properties mounted,canmount and only run mount -a if the dataset is not mounted, but should be by config ** this prevents the code from constantly running zfs mount -a in case the system has canmount=off on the root-dataset ** however in that case, if the (child) datasets were not mounted due to a timeout, they will not get mounted (as before) Stoiko Ivanov (3): zfspoolplugin: activate_storage: minor cleanup zfspoolplugin: check if mounted instead of imported zfspoolplugin: check if imported before importing PVE/Storage/ZFSPoolPlugin.pm | 49 +++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 14 deletions(-) -- 2.20.1