All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Constantine <Kevin.Constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Steve Dickson <SteveD@redhat.com>
Subject: Re: [PATCH 2/2] Allow nfs/vers=4 option in text-based mount commands
Date: Thu, 07 May 2009 13:03:08 -0700	[thread overview]
Message-ID: <4A033E7C.9060605@disney.com> (raw)
In-Reply-To: <6BEE21E5-A57E-46EA-A9A2-AED95715BFDE@oracle.com>

Chuck Lever wrote:
> 
> On May 5, 2009, at 5:46 PM, Kevin Constantine wrote:
> 
>> This allows a user to specify nfsvers=4, or vers=4 on the mount
>> commandline and have mount.nfs4 called as though fstype=nfs4 were
>> specified.  This patch handles the nfsmount_string case in
>> mount.c's try_mount().
>>
>> We get the value of the "vers=" or "nfsvers=" from the nfsmount_info
>> structure, and if the value equals 4, we set the fstype to nfs4, and
>> remove the nfsvers/vers options from the structure since it shouldn't
>> be there in the first place, and we don't want to pass it along down
>> the stack.
>>
>> po_get_numeric returns the rightmost instance, so we honor the last
>> value of nfsvers/vers in the event that it is overridden later in the
>> options string.
>>
>> Signed-off-by: Kevin Constantine <kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
>> ---
>> utils/mount/stropts.c |    9 +++++++++
>> 1 files changed, 9 insertions(+), 0 deletions(-)
>>
>> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
>> index c369136..72b0d13 100644
>> --- a/utils/mount/stropts.c
>> +++ b/utils/mount/stropts.c
>> @@ -754,6 +754,15 @@ static const char *nfs_background_opttbl[] = {
>>
>> static int nfsmount_start(struct nfsmount_info *mi)
>> {
>> +    long tmp;
>> +    po_get_numeric(mi->options, "vers", &tmp);
>> +    po_get_numeric(mi->options, "nfsvers", &tmp);
> 
> If someone specifies both a vers= and a nfsvers= on the command line, 
> this won't handle it.  You need to implement a rightmost search, as 
> Steve's patch (posted previously on this list) did.
> 

I can't seem to find Steve's patches relating to this issue.  I'm 
assuming that since there are already patches related to this, it's not 
worth pursuing these particular patches.

Let me know

-kevin

>> +    if (tmp == 4) {
>> +        mi->type = "nfs4";
>> +        po_remove_all(mi->options, "vers");
>> +        po_remove_all(mi->options, "nfsvers");
>> +    }
>> +
>>     if (!nfs_validate_options(mi))
>>         return EX_FAIL;
>>
>> -- 
>> 1.6.2.1
>>
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
------------------------------------------------------------
Kevin Constantine

Systems Engineer		t: 818.460.8221
Walt Disney Animation Studios	e: kevin.constantine-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org

Any sufficiently advanced technology is indistinguishable from magic.
     - Arthur C. Clarke

  reply	other threads:[~2009-05-07 20:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-05 21:46 Allow vers=4 and nfsvers=4 mount options Kevin Constantine
     [not found] ` <1241560004-16787-1-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-05-05 21:46   ` [PATCH 1/2] Allow nfs/vers=4 option in old style mount commands Kevin Constantine
     [not found]     ` <1241560004-16787-2-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-05-05 21:46       ` [PATCH 2/2] Allow nfs/vers=4 option in text-based " Kevin Constantine
     [not found]         ` <1241560004-16787-3-git-send-email-kevin.constantine-FfNkGbSheRGpB8w63BLUukEOCMrvLtNR@public.gmane.org>
2009-05-05 22:02           ` Chuck Lever
2009-05-07 20:03             ` Kevin Constantine [this message]
     [not found]               ` <4A033E7C.9060605-P5ys19MLBK/QT0dZR+AlfA@public.gmane.org>
2009-05-07 20:47                 ` Chuck Lever
2009-05-05 22:08       ` [PATCH 1/2] Allow nfs/vers=4 option in old style " Chuck Lever

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=4A033E7C.9060605@disney.com \
    --to=kevin.constantine-ffnkgbshergpb8w63bluukeocmrvltnr@public.gmane.org \
    --cc=SteveD@redhat.com \
    --cc=chuck.lever@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.