From 59fdc2b71e5da8eaf3c821a5c55f410f58da200a Mon Sep 17 00:00:00 2001 From: Stoiko Ivanov Date: Tue, 29 Sep 2020 18:49:44 +0200 Subject: [PATCH] fix regression in zfs volume activation commit 815df2dd08ac4c7295135262e60d64fbb57b8f5c introduced a small issue when activating linked clone volumes - the volname passed contains basevol/subvol, which needs to be translated to subvol. using the path method should be a robust way to get the actual path for activation. Found and tested by building the package as root (otherwise the zfs regressiontests are skipped). Reported-by: Thomas Lamprecht Signed-off-by: Stoiko Ivanov --- PVE/Storage/ZFSPoolPlugin.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm index 4f8df5e..6ac05b4 100644 --- a/PVE/Storage/ZFSPoolPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -554,9 +554,10 @@ sub activate_volume { if ($format eq 'raw') { $class->zfs_wait_for_zvol_link($scfg, $volname); } elsif ($format eq 'subvol') { - my $mounted = $class->zfs_get_properties($scfg, 'mounted', "$scfg->{pool}/$volname"); + my ($path, undef, undef) = $class->path($scfg, $volname, $storeid); + my $mounted = $class->zfs_get_properties($scfg, 'mounted', "$path"); if ($mounted !~ m/^yes$/) { - $class->zfs_request($scfg, undef, 'mount', "$scfg->{pool}/$volname"); + $class->zfs_request($scfg, undef, 'mount', "$path"); } }