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) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 977EB60FE3 for ; Thu, 19 Nov 2020 11:30:28 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7F55123CA4 for ; Thu, 19 Nov 2020 11:29:58 +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 0C80E23C9C for ; Thu, 19 Nov 2020 11:29:58 +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 BEAC743B9E for ; Thu, 19 Nov 2020 11:29:57 +0100 (CET) From: Fabian Ebner To: pve-devel@lists.proxmox.com Date: Thu, 19 Nov 2020 11:29:53 +0100 Message-Id: <20201119102953.27271-1-f.ebner@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.010 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] fix volume activation for ZFS subvols 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: Thu, 19 Nov 2020 10:30:28 -0000 When using the path to request properties, and no ZFS file system is mounted at that path, ZFS will fall back to the parent filesystem: > # zfs unmount myzpool/subvol-172-disk-0 > # zfs get mounted /myzpool/subvol-172-disk-0 > NAME PROPERTY VALUE SOURCE > myzpool mounted yes - > # zfs get mounted myzpool/subvol-172-disk-0 > NAME PROPERTY VALUE SOURCE > myzpool/subvol-172-disk-0 mounted no - Thus, we cannot use the path and need to use the dataset directly. Signed-off-by: Fabian Ebner --- See commit 59fdc2b71e5da8eaf3c821a5c55f410f58da200a for more context. I did build the package as root to run the zfs regressiontests this time. PVE/Storage/ZFSPoolPlugin.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm index 07540b3..2f0a80a 100644 --- a/PVE/Storage/ZFSPoolPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -549,15 +549,14 @@ sub activate_volume { return 1 if defined($snapname); - my (undef, undef, undef, undef, undef, undef, $format) = $class->parse_volname($volname); + my (undef, $dataset, undef, undef, undef, undef, $format) = $class->parse_volname($volname); if ($format eq 'raw') { $class->zfs_wait_for_zvol_link($scfg, $volname); } elsif ($format eq 'subvol') { - my ($path, undef, undef) = $class->path($scfg, $volname, $storeid); - my $mounted = $class->zfs_get_properties($scfg, 'mounted', "$path"); + my $mounted = $class->zfs_get_properties($scfg, 'mounted', "$scfg->{pool}/$dataset"); if ($mounted !~ m/^yes$/) { - $class->zfs_request($scfg, undef, 'mount', "$path"); + $class->zfs_request($scfg, undef, 'mount', "$scfg->{pool}/$dataset"); } } -- 2.20.1