Return-Path: linux-nfs-owner@vger.kernel.org Received: from userp1040.oracle.com ([156.151.31.81]:29323 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752812Ab2KSSVw convert rfc822-to-8bit (ORCPT ); Mon, 19 Nov 2012 13:21:52 -0500 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: [RFC PATCH V2] mount: Added the -o v4.1 mount option From: Chuck Lever In-Reply-To: <1353339810-19126-1-git-send-email-steved@redhat.com> Date: Mon, 19 Nov 2012 13:21:45 -0500 Cc: Linux NFS Mailing List Message-Id: <30DFD4FD-3442-4F35-B576-EA597E21F4CE@oracle.com> References: <1353339810-19126-1-git-send-email-steved@redhat.com> To: Steve Dickson Sender: linux-nfs-owner@vger.kernel.org List-ID: On Nov 19, 2012, at 10:43 AM, Steve Dickson wrote: > This patch will convert -o v4.1, vers=4.1 or nfsvers=4.1 into > the corresponding "v4,minorversion=1", "vers=4,minorversion=1" > or "nfsvers=4,minorversion=1" options. I had a couple of thoughts about this. As Trond points out, mount.nfs really should not use option "minorversion=" here, except on kernels that do not support "vers=4.x". That will add complexity, certainly. In addition, I think we can expect the need for support for "v4.2" and "v4.0" (perhaps) in the near future, and then subsequently "v4.3" and so on. Since that is close at hand, we should consider the need to add those as we design this. Perhaps instead of editing the mount option string directly in nfs_nfs_version(), you might add a "*minorversion" argument to nfs_nfs_version() function and let its callers finish the work, just as is done with "*version" today. That might also make it easier to add the logic that changes behavior based on kernel version. > > Signed-off-by: Steve Dickson > --- > utils/mount/network.c | 18 ++++++++++++++++-- > utils/mount/nfs.man | 13 +++++++++++++ > 2 files changed, 29 insertions(+), 2 deletions(-) > > diff --git a/utils/mount/network.c b/utils/mount/network.c > index e7bd522..36aa03b 100644 > --- a/utils/mount/network.c > +++ b/utils/mount/network.c > @@ -94,6 +94,7 @@ static const char *nfs_version_opttbl[] = { > "v2", > "v3", > "v4", > + "v4.1", > "vers", > "nfsvers", > NULL, > @@ -1244,11 +1245,20 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version) > case 2: /* v4 */ > *version = 4; > return 1; > - case 3: /* vers */ > + case 3: /* v4.1 */ > + *version = 4; > + po_remove_all(options, "v4.1"); > + po_append(options, "v4,minorversion=1"); > + return 1; > + case 4: /* vers */ > switch (po_get_numeric(options, "vers", &tmp)) { > case PO_FOUND: > if (tmp >= 2 && tmp <= 4) { > *version = tmp; > + if (strcmp(po_get(options, "vers"), "4.1") == 0) { > + po_remove_all(options, "vers"); > + po_append(options, "vers=4,minorversion=1"); > + } > return 1; > } > return 0; > @@ -1261,11 +1271,15 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version) > progname); > return 0; > } > - case 4: /* nfsvers */ > + case 5: /* nfsvers */ > switch (po_get_numeric(options, "nfsvers", &tmp)) { > case PO_FOUND: > if (tmp >= 2 && tmp <= 4) { > *version = tmp; > + if (strcmp(po_get(options, "nfsvers"), "4.1") == 0) { > + po_remove_all(options, "nfsvers"); > + po_append(options, "nfsvers=4,minorversion=1"); > + } > return 1; > } > return 0; > diff --git a/utils/mount/nfs.man b/utils/mount/nfs.man > index c15de98..8d1bb56 100644 > --- a/utils/mount/nfs.man > +++ b/utils/mount/nfs.man > @@ -762,6 +762,19 @@ by 'nolock'/'lock' mount option. > Use these options, along with the options in the first subsection above, > for NFS version 4 and newer. > .TP 1.5i > +.BI minorversion= n > +Specifies the protocol minor version number. > +NFSv4 introduces "minor versioning," where NFS protocol enhancements can > +be introduced without bumping the NFS protocol version number. > +.IP > +The minor version can also be be specified using the > +.B vers= > +option. > +For example, specifying > +.B vers=4.1 > +is the same as specifying > +.BR vers=4,minorversion=1 . > +.TP 1.5i > .BI proto= netid > The > .I netid > -- > 1.7.11.7 > > -- > 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 -- Chuck Lever chuck[dot]lever[at]oracle[dot]com