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 3EDD963613 for ; Tue, 22 Dec 2020 13:19:25 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 324842BF77 for ; Tue, 22 Dec 2020 13:18:55 +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) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id CFDE32BF6E for ; Tue, 22 Dec 2020 13:18:53 +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 9AB1F455CB for ; Tue, 22 Dec 2020 13:18:53 +0100 (CET) From: Aaron Lauterer To: pve-devel@lists.proxmox.com Date: Tue, 22 Dec 2020 13:18:52 +0100 Message-Id: <20201222121852.15803-1-a.lauterer@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.012 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. [proxmox.com, dirplugin.pm] Subject: [pve-devel] [PATCH storage] fix 3214: DirPlugin: die early if mountpoint not mounted 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, 22 Dec 2020 12:19:25 -0000 If the `is_mountpoint` option is enabled, it is sensible to first check for the mountpoint before proceeding any further in the storage activation. The old behaviour would create the path to the mountpoint if the `mdkir` option wasn't set to false. This resulted in mountpoints further up the path to not mount anymore, e.g. nested ZFS datasets. Signed-off-by: Aaron Lauterer --- There is another patch[0] already for this bug report but it deals with a related, but different problem of not creating the internal storage directory structure if `mkdir 0` was set. [0] https://lists.proxmox.com/pipermail/pve-devel/2020-December/046572.html PVE/Storage/DirPlugin.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PVE/Storage/DirPlugin.pm b/PVE/Storage/DirPlugin.pm index 2267f11..81aaf2b 100644 --- a/PVE/Storage/DirPlugin.pm +++ b/PVE/Storage/DirPlugin.pm @@ -132,17 +132,17 @@ sub status { sub activate_storage { my ($class, $storeid, $scfg, $cache) = @_; - my $path = $scfg->{path}; - if (!defined($scfg->{mkdir}) || $scfg->{mkdir}) { - mkpath $path; - } - my $mp = parse_is_mountpoint($scfg); if (defined($mp) && !path_is_mounted($mp, $cache->{mountdata})) { die "unable to activate storage '$storeid' - " . "directory is expected to be a mount point but is not mounted: '$mp'\n"; } + my $path = $scfg->{path}; + if (!defined($scfg->{mkdir}) || $scfg->{mkdir}) { + mkpath $path; + } + $class->SUPER::activate_storage($storeid, $scfg, $cache); } -- 2.20.1