From 5b715fd9845dfd07e7ed5657706498bb137cb9e9 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Fri, 19 Feb 2021 15:04:53 +0100 Subject: [PATCH] zpool: activate: drop intermediate state variable, return directly Signed-off-by: Thomas Lamprecht --- PVE/Storage/ZFSPoolPlugin.pm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm index 9dfe86f..cf63d7c 100644 --- a/PVE/Storage/ZFSPoolPlugin.pm +++ b/PVE/Storage/ZFSPoolPlugin.pm @@ -530,8 +530,6 @@ sub activate_storage { my $pool = ($dataset =~ s!/.*$!!r); my $dataset_mounted = sub { - my $mounted = 0; - my $mounts = eval { PVE::ProcFSTools::parse_proc_mounts() }; warn "$@\n" if $@; foreach my $mp (@$mounts) { @@ -541,10 +539,9 @@ sub activate_storage { # root-dataset could have 'canmount=off'. If any child is mounted # heuristically assume that `zfs mount -a` was successful next if $what !~ m!^$dataset(?:/|$)!; - $mounted = 1; - last; + return 1; } - return $mounted; + return 0; }; my $pool_imported = sub {