linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joro@8bytes.org>
To: bjschuma@netapp.com
Cc: Trond.Myklebust@netapp.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] NFS: Use the NFS_DEFAULT_VERSION for v2 and v3 mounts
Date: Fri, 8 Jun 2012 18:00:31 +0200	[thread overview]
Message-ID: <20120608160031.GY12795@8bytes.org> (raw)
In-Reply-To: <1339169576-27307-1-git-send-email-bjschuma@netapp.com>

On Fri, Jun 08, 2012 at 11:32:56AM -0400, bjschuma@netapp.com wrote:
> From: Bryan Schumaker <bjschuma@netapp.com>
> 
> Older versions of nfs utils don't always pass a "vers=" mount option for
> NFS.  This chould lead to attempts at using NFS v0 due to a zeroed out
> nfs_parsed_mount_data struct.  I solve this by setting the default NFS
> version to NFS_DEFAULT_VERSION in the v2 and v3 cases (v4 has already been
> taken care of by a similar patch).
> 
> Reported-by: Joerg Roedel <joro@&bytes.org>

8bytes.org

> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
> ---
>  fs/nfs/super.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index ff656c0..97a3b30 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -1867,6 +1867,7 @@ static int nfs23_validate_mount_data(void *options,
>  	if (data == NULL)
>  		goto out_no_data;
>  
> +	args->version = NFS_DEFAULT_VERSION;
>  	switch (data->version) {
>  	case 1:
>  		data->namlen = 0;

Hmm, I still think that the revert-patch is a better solution. The
data-structure is allocated and initialized in
nfs_alloc_parsed_mount_data() so this function is the logical place to
also initialize the version-field with a meaningful value.

Regards,

	Joerg



      reply	other threads:[~2012-06-08 16:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08 15:32 [PATCH] NFS: Use the NFS_DEFAULT_VERSION for v2 and v3 mounts bjschuma
2012-06-08 16:00 ` Joerg Roedel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120608160031.GY12795@8bytes.org \
    --to=joro@8bytes.org \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bjschuma@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).