zpool: activate: drop intermediate state variable, return directly

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2021-02-19 15:04:53 +01:00
parent c31aee36d8
commit 5b715fd984

View File

@ -530,8 +530,6 @@ sub activate_storage {
my $pool = ($dataset =~ s!/.*$!!r); my $pool = ($dataset =~ s!/.*$!!r);
my $dataset_mounted = sub { my $dataset_mounted = sub {
my $mounted = 0;
my $mounts = eval { PVE::ProcFSTools::parse_proc_mounts() }; my $mounts = eval { PVE::ProcFSTools::parse_proc_mounts() };
warn "$@\n" if $@; warn "$@\n" if $@;
foreach my $mp (@$mounts) { foreach my $mp (@$mounts) {
@ -541,10 +539,9 @@ sub activate_storage {
# root-dataset could have 'canmount=off'. If any child is mounted # root-dataset could have 'canmount=off'. If any child is mounted
# heuristically assume that `zfs mount -a` was successful # heuristically assume that `zfs mount -a` was successful
next if $what !~ m!^$dataset(?:/|$)!; next if $what !~ m!^$dataset(?:/|$)!;
$mounted = 1; return 1;
last;
} }
return $mounted; return 0;
}; };
my $pool_imported = sub { my $pool_imported = sub {