From: NeilBrown <neilb@suse.com>
To: Steve Dickson <SteveD@redhat.com>
Cc: linux-nfs@vger.kernel.org, "J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 2/4] nfsd: Do not permit manipulation of NFSv4.0, e.g. "-N 4.0"
Date: Wed, 21 Dec 2016 11:19:14 +1100 [thread overview]
Message-ID: <148227955395.31345.17174406788901291213.stgit@noble> (raw)
In-Reply-To: <148227940052.31345.1974080582264239934.stgit@noble>
The code maps this into "-4.32", which the kernel rejects.
The kernel also rejects "-4.0" (when written to the 'versions'
file).
So require the minor number to be at least NFS4_MINMINOR, which is '1'.
Signed-off-by: NeilBrown <neilb@suse.com>
---
utils/nfsd/nfsd.c | 4 ++--
utils/nfsd/nfsd.man | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c
index eb346f67f9e4..20f4b7952203 100644
--- a/utils/nfsd/nfsd.c
+++ b/utils/nfsd/nfsd.c
@@ -179,7 +179,7 @@ main(int argc, char **argv)
case 4:
if (*p == '.') {
int i = atoi(p+1);
- if (i > NFS4_MAXMINOR) {
+ if (i < NFS4_MINMINOR || i > NFS4_MAXMINOR) {
fprintf(stderr, "%s: unsupported minor version\n", optarg);
exit(1);
}
@@ -201,7 +201,7 @@ main(int argc, char **argv)
case 4:
if (*p == '.') {
int i = atoi(p+1);
- if (i > NFS4_MAXMINOR) {
+ if (i < NFS4_MINMINOR || i > NFS4_MAXMINOR) {
fprintf(stderr, "%s: unsupported minor version\n", optarg);
exit(1);
}
diff --git a/utils/nfsd/nfsd.man b/utils/nfsd/nfsd.man
index 8d198e25685e..8901fb6c6872 100644
--- a/utils/nfsd/nfsd.man
+++ b/utils/nfsd/nfsd.man
@@ -57,7 +57,7 @@ This option can be used to request that
.B rpc.nfsd
does not offer certain versions of NFS. The current version of
.B rpc.nfsd
-can support NFS versions 2,3,4 and the newer version 4.1.
+can support major NFS versions 2,3,4 and the minor versions 4.1 and 4.2.
.TP
.B \-s " or " \-\-syslog
By default,
@@ -82,7 +82,7 @@ This option can be used to request that
.B rpc.nfsd
offer certain versions of NFS. The current version of
.B rpc.nfsd
-can support NFS versions 2,3,4 and the newer version 4.1.
+can support major NFS versions 2,3,4 and the minor versions 4.1 and 4.2.
.TP
.B \-L " or " \-\-lease-time seconds
Set the lease-time used for NFSv4. This corresponds to how often
next prev parent reply other threads:[~2016-12-21 0:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-21 0:19 [PATCH 0/4] Assorted nfs-utils patches NeilBrown
2016-12-21 0:19 ` [PATCH 1/4] nfsd: fix setting of minor version from config file NeilBrown
2016-12-21 0:19 ` NeilBrown [this message]
2016-12-21 0:19 ` [PATCH 4/4] mountd: delay reading etab until first request arrives NeilBrown
2016-12-22 20:35 ` J. Bruce Fields
2016-12-22 23:16 ` NeilBrown
2016-12-23 0:35 ` J. Bruce Fields
2016-12-21 0:19 ` [PATCH 3/4] nfs-server-generator: avoid using syslog NeilBrown
2017-01-04 16:56 ` [PATCH 0/4] Assorted nfs-utils patches Steve Dickson
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=148227955395.31345.17174406788901291213.stgit@noble \
--to=neilb@suse.com \
--cc=SteveD@redhat.com \
--cc=bfields@redhat.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