]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/ZFSPoolPlugin.pm
zpool: activate: drop intermediate state variable, return directly
[pve-storage.git] / PVE / Storage / ZFSPoolPlugin.pm
index 4806ba5afdf4d651207a345293e2a2783b1a390c..cf63d7caf07286c2c989c1b74e8d6768cb791032 100644 (file)
@@ -530,8 +530,6 @@ sub activate_storage {
     my $pool = ($dataset =~ s!/.*$!!r);
 
     my $dataset_mounted = sub {
-       my $mounted = 0;
-       my $dataset_dec = PVE::ProcFSTools::decode_mount($dataset);
        my $mounts = eval { PVE::ProcFSTools::parse_proc_mounts() };
        warn "$@\n" if $@;
        foreach my $mp (@$mounts) {
@@ -540,11 +538,10 @@ sub activate_storage {
            # check for root-dataset of storage or any child-dataset.
            # root-dataset could have 'canmount=off'. If any child is mounted
            # heuristically assume that `zfs mount -a` was successful
-           next if $what !~ m!^$dataset_dec(?:/|$)!;
-           $mounted = 1;
-           last;
+           next if $what !~ m!^$dataset(?:/|$)!;
+           return 1;
        }
-       return $mounted;
+       return 0;
     };
 
     my $pool_imported = sub {