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: Re: [PATCH 2/3] NFSD: fix nfsd_minorversion(.., NFSD_AVAIL)
Date: Mon, 13 Mar 2017 08:58:22 +1100	[thread overview]
Message-ID: <87innef98h.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20170310221648.GN29791@fieldses.org>

[-- Attachment #1: Type: text/plain, Size: 1316 bytes --]

On Fri, Mar 10 2017, J. Bruce Fields wrote:

> On Fri, Mar 10, 2017 at 11:36:39AM +1100, NeilBrown wrote:
>> 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.
>
> It's used?  I don't see it.--b.

You are correct of course.  NFSD_AVAIL is used once, but not with
nfsd_minorversion.
Would it ever make sense to selectively include different minor
versions at compile time?  Probably not, but it probably doesn't matter
anyway.

NeilBrown


>
>> 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:
>> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  parent reply	other threads:[~2017-03-12 21:58 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 ` [PATCH 3/3] NFSD: fix nfsd_reset_versions for NFSv4 NeilBrown
2017-03-10  0:36 ` [PATCH 2/3] NFSD: fix nfsd_minorversion(.., NFSD_AVAIL) NeilBrown
2017-03-10 22:16   ` J. Bruce Fields
2017-03-10 22:26     ` J. Bruce Fields
2017-03-12 21:58     ` NeilBrown [this message]
2017-03-10  0:36 ` [PATCH 1/3] NFSD: further refinement of content of /proc/fs/nfsd/versions 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=87innef98h.fsf@notabene.neil.brown.name \
    --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).