[pve-devel] [PATCH storage] nfs/glusterfs: is_mounted fixes

Dietmar Maurer dietmar at proxmox.com
Wed Dec 9 09:23:17 CET 2015


applied with a small fix (see comment inline)

> On December 9, 2015 at 8:44 AM Wolfgang Bumiller <w.bumiller at proxmox.com>
> wrote:
> 
> 
> The parse_proc_mounts change made the glusterfs is_mounted
> check fail (causing it to be shown as inactive on the GUI).
> The NFS check was stricter (not allowing a trailing / in the
> source anymore).
> ---
>  PVE/Storage/GlusterfsPlugin.pm | 2 +-
>  PVE/Storage/NFSPlugin.pm       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/PVE/Storage/GlusterfsPlugin.pm b/PVE/Storage/GlusterfsPlugin.pm
> index a6ca950..315c5a6 100644
> --- a/PVE/Storage/GlusterfsPlugin.pm
> +++ b/PVE/Storage/GlusterfsPlugin.pm
> @@ -74,7 +74,7 @@ sub glusterfs_is_mounted {
>  
>      return $mountpoint if grep {
>  	$_->[2] eq 'fuse.glusterfs' &&
> -	$_->[0] eq $volume &&
> +	$_->[0] =~ /^\S+:\Q$volume\E$/ &&
>  	$_->[1] eq $mountpoint
>      } @$mountdata;
>      return undef;
> diff --git a/PVE/Storage/NFSPlugin.pm b/PVE/Storage/NFSPlugin.pm
> index 047c3a4..0555159 100644
> --- a/PVE/Storage/NFSPlugin.pm
> +++ b/PVE/Storage/NFSPlugin.pm
> @@ -23,7 +23,7 @@ sub nfs_is_mounted {
>      $mountdata = PVE::ProcFSTools::parse_proc_mounts() if !$mountdata;
>      return $mountpoint if grep {
>  	$_->[2] eq 'nfs' &&
> -	$_->[0] eq $source &&
> +	$_->[0] =~ m|^\Q$source\E/?| &&

I changed that to

+	$_->[0] =~ m|^\Q$source\E/?$| &&

>  	$_->[1] eq $mountpoint
>      } @$mountdata;
>      return undef;
> -- 
> 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