[pve-devel] [PATCH storage] fix #1165: only check mount status when is_mountpoint is set

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Oct 13 08:31:54 CEST 2016


applied

On Wed, Oct 12, 2016 at 09:33:12AM +0200, Fabian Grünbichler wrote:
> otherwise the status() method returns garbage for non-mount
> point directory storages.
> ---
>  PVE/Storage/DirPlugin.pm | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/PVE/Storage/DirPlugin.pm b/PVE/Storage/DirPlugin.pm
> index 39f3b30..629fa17 100644
> --- a/PVE/Storage/DirPlugin.pm
> +++ b/PVE/Storage/DirPlugin.pm
> @@ -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);
>  }
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list