From 75815bf556ab04608a1f2dc6b6ca38f61ff9acdf Mon Sep 17 00:00:00 2001 From: Fabian Ebner Date: Tue, 18 Feb 2020 11:14:59 +0100 Subject: [PATCH] Check whether 'zfs get mountpoint' returns a valid absolute path The command 'zfs get mountpoint' can return 'none' and so 'mountpoint none' was written to storage.cfg, which would block the fall-back to using the default mount point when requesting a path, see [0]. [0]: https://forum.proxmox.com/threads/zfs-backup-with-snapshot-mode-fails.61927/#post-284123 Signed-off-by: Fabian Ebner --- PVE/Storage/ZFSPoolPlugin.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm index d72ee16..b538e3b 100644 --- a/PVE/Storage/ZFSPoolPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -153,8 +153,10 @@ sub on_add_hook { my $cfg_mountpoint = $scfg->{mountpoint}; # ignore failure, pool might currently not be imported - my $mountpoint = eval { - $class->zfs_get_properties($scfg, 'mountpoint', $scfg->{pool}, 1) + my $mountpoint; + eval { + my $res = $class->zfs_get_properties($scfg, 'mountpoint', $scfg->{pool}, 1); + $mountpoint = PVE::Storage::Plugin::verify_path($res, 1) if defined($res); }; if (defined($cfg_mountpoint)) { -- 2.39.5