linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.com>
To: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Trond Myklebust <trondmy@primarydata.com>, linux-nfs@vger.kernel.org
Subject: [PATCH 2/3] NFSD: fix nfsd_minorversion(.., NFSD_AVAIL)
Date: Fri, 10 Mar 2017 11:36:39 +1100	[thread overview]
Message-ID: <148910619931.3032.2841124907029105276.stgit@noble> (raw)
In-Reply-To: <148910618557.3032.8265198632788708076.stgit@noble>

Current code will return 1 if the version is supported,
and -1 if it isn't.
This is confusing and inconsistent with the one place where this
is used.
So change to return 1 if it is supported, and zero if not.
i.e. an error is never returned.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 fs/nfsd/nfssvc.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 786a4a2cb2d7..892137b1e330 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -167,7 +167,8 @@ nfsd_adjust_nfsd_versions4(void)
 
 int nfsd_minorversion(u32 minorversion, enum vers_op change)
 {
-	if (minorversion > NFSD_SUPPORTED_MINOR_VERSION)
+	if (minorversion > NFSD_SUPPORTED_MINOR_VERSION &&
+	    change != NFSD_AVAIL)
 		return -1;
 	switch(change) {
 	case NFSD_SET:



  reply	other threads:[~2017-03-10  0:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-10  0:36 [PATCH 0/3] NFSD: Various fixes for the 'versions' file NeilBrown
2017-03-10  0:36 ` NeilBrown [this message]
2017-03-10 22:16   ` [PATCH 2/3] NFSD: fix nfsd_minorversion(.., NFSD_AVAIL) J. Bruce Fields
2017-03-10 22:26     ` J. Bruce Fields
2017-03-12 21:58     ` NeilBrown
2017-03-10  0:36 ` [PATCH 1/3] NFSD: further refinement of content of /proc/fs/nfsd/versions NeilBrown
2017-03-10  0:36 ` [PATCH 3/3] NFSD: fix nfsd_reset_versions for NFSv4 NeilBrown

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=148910619931.3032.2841124907029105276.stgit@noble \
    --to=neilb@suse.com \
    --cc=bfields@fieldses.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@primarydata.com \
    /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).