Re: [PATCH 3/3] NFS: Consolidate the parsing of the '-ov4.x' and '-overs=4.x' mount options

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steve,

When testing this patch, I noticed that the 'mount' program seems to be
adding a 'vers=4' to my mount options.

IOW: when I tested the following mount command:

        mount -t nfs -ov4.1 foo:/bar /mnt

the kernel ended up parsing

   'v4.1,vers=4,addr=xxx.xxx.xxx.xxx, clientaddr=yyy.yyy.yyy.yyy'

which caused a bug in my original patches (where I had 'vers=4'
automatically set minorversion=0).

Any idea why we're adding that extra vers=4?

Cheers
  Trond

On Fri, 2012-03-02 at 14:07 -0500, Trond Myklebust wrote:
> Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
> ---
>  fs/nfs/super.c |   31 +++----------------------------
>  1 files changed, 3 insertions(+), 28 deletions(-)
> 
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 7f0c93f..f4ccdae 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -80,7 +80,6 @@ enum {
>  	Opt_cto, Opt_nocto,
>  	Opt_ac, Opt_noac,
>  	Opt_lock, Opt_nolock,
> -	Opt_v2, Opt_v3, Opt_v4, Opt_v4_0, Opt_v4_1,
>  	Opt_udp, Opt_tcp, Opt_rdma,
>  	Opt_acl, Opt_noacl,
>  	Opt_rdirplus, Opt_nordirplus,
> @@ -133,11 +132,6 @@ static const match_table_t nfs_mount_option_tokens = {
>  	{ Opt_noac, "noac" },
>  	{ Opt_lock, "lock" },
>  	{ Opt_nolock, "nolock" },
> -	{ Opt_v2, "v2" },
> -	{ Opt_v3, "v3" },
> -	{ Opt_v4, "v4" },
> -	{ Opt_v4_0, "v4.0" },
> -	{ Opt_v4_1, "v4.1" },
>  	{ Opt_udp, "udp" },
>  	{ Opt_tcp, "tcp" },
>  	{ Opt_rdma, "rdma" },
> @@ -183,6 +177,9 @@ static const match_table_t nfs_mount_option_tokens = {
>  	{ Opt_fscache_uniq, "fsc=%s" },
>  	{ Opt_local_lock, "local_lock=%s" },
>  
> +	/* The following needs to be listed after all other options */
> +	{ Opt_nfsvers, "v%s" },
> +
>  	{ Opt_err, NULL }
>  };
>  
> @@ -1228,28 +1225,6 @@ static int nfs_parse_mount_options(char *raw,
>  			mnt->flags |= (NFS_MOUNT_LOCAL_FLOCK |
>  				       NFS_MOUNT_LOCAL_FCNTL);
>  			break;
> -		case Opt_v2:
> -			mnt->flags &= ~NFS_MOUNT_VER3;
> -			mnt->version = 2;
> -			break;
> -		case Opt_v3:
> -			mnt->flags |= NFS_MOUNT_VER3;
> -			mnt->version = 3;
> -			break;
> -		case Opt_v4:
> -			mnt->flags &= ~NFS_MOUNT_VER3;
> -			mnt->version = 4;
> -			break;
> -		case Opt_v4_0:
> -			mnt->flags &= ~NFS_MOUNT_VER3;
> -			mnt->version = 4;
> -			mnt->minorversion = 0;
> -			break;
> -		case Opt_v4_1:
> -			mnt->flags &= ~NFS_MOUNT_VER3;
> -			mnt->version = 4;
> -			mnt->minorversion = 1;
> -			break;
>  		case Opt_udp:
>  			mnt->flags &= ~NFS_MOUNT_TCP;
>  			mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP;

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux