]> git.proxmox.com Git - pve-storage.git/commitdiff
zpool: avoid wrong mount-decoding of dataset
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 19 Feb 2021 14:01:36 +0000 (15:01 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 19 Feb 2021 14:01:39 +0000 (15:01 +0100)
this was mistakenly done as the procfs code uses it and it was
assumed we need to decode this too to get both in the same
encoding-space and thus correct comparission.

But only procfs has that encoding, we don't have it for pool values
in the storage config, so we must not do a decode on that value, that
could potentially break.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/Storage/ZFSPoolPlugin.pm

index 4806ba5afdf4d651207a345293e2a2783b1a390c..9dfe86f2bf5e6977ce3286f5884bacc4957eca4b 100644 (file)
@@ -531,7 +531,7 @@ sub activate_storage {
 
     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,7 +540,7 @@ 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(?:/|$)!;
+           next if $what !~ m!^$dataset(?:/|$)!;
            $mounted = 1;
            last;
        }