]> git.proxmox.com Git - pve-storage.git/commitdiff
fix #1165: only check mount status when is_mountpoint is set
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 12 Oct 2016 07:33:12 +0000 (09:33 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 13 Oct 2016 06:29:30 +0000 (08:29 +0200)
otherwise the status() method returns garbage for non-mount
point directory storages.

PVE/Storage/DirPlugin.pm

index 39f3b30e103c6e23cdc1fa4bc58d135d02c81692..629fa17320d264f5b839fdc4f9a4a51a98c25929 100644 (file)
@@ -76,12 +76,14 @@ sub path_is_mounted {
 sub status {
     my ($class, $storeid, $scfg, $cache) = @_;
 
-    $cache->{mountdata} = PVE::ProcFSTools::parse_proc_mounts()
-       if !$cache->{mountdata};
+    if ($scfg->{is_mountpoint}) {
+       $cache->{mountdata} = PVE::ProcFSTools::parse_proc_mounts()
+           if !$cache->{mountdata};
 
-    my $path = $scfg->{path};
+       my $path = $scfg->{path};
 
-    return undef if !path_is_mounted($path, $cache->{mountdata});
+       return undef if !path_is_mounted($path, $cache->{mountdata});
+    }
 
     return $class->SUPER::status($storeid, $scfg, $cache);
 }