All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0
@ 2017-02-22 23:35 Trond Myklebust
  2017-02-22 23:35 ` [PATCH v2 1/2] nfsd: Allow enabling NFSv4.x without also requiring NFSv4.0 Trond Myklebust
  2017-02-23  0:13 ` [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0 NeilBrown
  0 siblings, 2 replies; 10+ messages in thread
From: Trond Myklebust @ 2017-02-22 23:35 UTC (permalink / raw)
  To: bfields, neilb; +Cc: linux-nfs

This patch series was intended as a standalone series. However it now
aims to fix up a few issues with Neil's initial patch:

1) When the user turns off all minor versions of NFSv4, then that should
   be equivalent to turning off NFSv4 support, and so when someone tries
   to mount, we should return RPC_PROG_MISMATCH.
2) Allow the user to use either '4.0' or '4' in order to enable or disable
   minor version 0. Other minor versions remain enabled/disabled using the
   '4.x' format.
3) Fix up the display of the minor versions so that we don't add '4.0'.
   Previous kernels have always assumed the '4' means 'minor version 0',
   so there should be no need to have both.

v2: Make incremental to Neil's patch
    Fix up display of the version string

Trond Myklebust (2):
  nfsd: Allow enabling NFSv4.x without also requiring NFSv4.0
  nfsd: Fix display of the version string

 fs/nfsd/nfsctl.c | 72 ++++++++++++++++++++++++++------------------------------
 fs/nfsd/nfssvc.c | 14 +++++++++++
 2 files changed, 48 insertions(+), 38 deletions(-)

-- 
2.9.3


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH v2 1/2] nfsd: Allow enabling NFSv4.x without also requiring NFSv4.0
  2017-02-22 23:35 [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0 Trond Myklebust
@ 2017-02-22 23:35 ` Trond Myklebust
  2017-02-22 23:35   ` [PATCH v2 2/2] nfsd: Fix display of the version string Trond Myklebust
  2017-02-23  0:13 ` [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0 NeilBrown
  1 sibling, 1 reply; 10+ messages in thread
From: Trond Myklebust @ 2017-02-22 23:35 UTC (permalink / raw)
  To: bfields, neilb; +Cc: linux-nfs

For some setups, we may want to allow clients to fall back to NFSv3, or
even to fail, if a specific minor version of NFSv4 is not enabled.
For instance, an application that relies on NFSv4.2 CLONE functionality
is simply not going to work when it falls back to NFSv4.1 or NFSv4.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfsd/nfsctl.c | 16 ++++++++--------
 fs/nfsd/nfssvc.c | 14 ++++++++++++++
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index d54fb0e3f30e..4bbba88416dc 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -561,6 +561,7 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
 		len = qword_get(&mesg, vers, size);
 		if (len <= 0) return -EINVAL;
 		do {
+			enum vers_op cmd;
 			sign = *vers;
 			if (sign == '+' || sign == '-')
 				num = simple_strtol((vers+1), &minorp, 0);
@@ -571,21 +572,20 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
 					return -EINVAL;
 				if (kstrtouint(minorp+1, 0, &minor) < 0)
 					return -EINVAL;
-				if (nfsd_minorversion(minor, sign == '-' ?
-						     NFSD_CLEAR : NFSD_SET) < 0)
-					return -EINVAL;
-				goto next;
-			}
+			} else
+				minor = 0;
+			cmd = sign == '-' ? NFSD_CLEAR : NFSD_SET;
 			switch(num) {
 			case 2:
 			case 3:
-			case 4:
-				nfsd_vers(num, sign == '-' ? NFSD_CLEAR : NFSD_SET);
+				nfsd_vers(num, cmd);
 				break;
+			case 4:
+				if (nfsd_minorversion(minor, cmd) >= 0)
+					break;
 			default:
 				return -EINVAL;
 			}
-		next:
 			vers += len + 1;
 		} while ((len = qword_get(&mesg, vers, size)) > 0);
 		/* If all get turned off, turn them back on, as
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index e6bfd96734c0..07bf3bd9687b 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -153,6 +153,18 @@ int nfsd_vers(int vers, enum vers_op change)
 	return 0;
 }
 
+static void
+nfsd_adjust_nfsd_versions4(void)
+{
+	unsigned i;
+
+	for (i = 0; i <= NFSD_SUPPORTED_MINOR_VERSION; i++) {
+		if (nfsd_supported_minorversions[i])
+			return;
+	}
+	nfsd_vers(4, NFSD_CLEAR);
+}
+
 int nfsd_minorversion(u32 minorversion, enum vers_op change)
 {
 	if (minorversion > NFSD_SUPPORTED_MINOR_VERSION)
@@ -160,9 +172,11 @@ int nfsd_minorversion(u32 minorversion, enum vers_op change)
 	switch(change) {
 	case NFSD_SET:
 		nfsd_supported_minorversions[minorversion] = true;
+		nfsd_vers(4, NFSD_SET);
 		break;
 	case NFSD_CLEAR:
 		nfsd_supported_minorversions[minorversion] = false;
+		nfsd_adjust_nfsd_versions4();
 		break;
 	case NFSD_TEST:
 		return nfsd_supported_minorversions[minorversion];
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH v2 2/2] nfsd: Fix display of the version string
  2017-02-22 23:35 ` [PATCH v2 1/2] nfsd: Allow enabling NFSv4.x without also requiring NFSv4.0 Trond Myklebust
@ 2017-02-22 23:35   ` Trond Myklebust
  0 siblings, 0 replies; 10+ messages in thread
From: Trond Myklebust @ 2017-02-22 23:35 UTC (permalink / raw)
  To: bfields, neilb; +Cc: linux-nfs

The current display code assumes that v4 minor version 0 is tracked by
the call to nfsd_vers(). Now it is tracked by nfsd_minorversion(), and
so we need to adjust the display code.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
---
 fs/nfsd/nfsctl.c | 56 ++++++++++++++++++++++++++------------------------------
 1 file changed, 26 insertions(+), 30 deletions(-)

diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 4bbba88416dc..73e75ac90525 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -536,6 +536,19 @@ static ssize_t write_pool_threads(struct file *file, char *buf, size_t size)
 	return rv;
 }
 
+static ssize_t
+nfsd_print_version_support(char *buf, int remaining, const char *sep,
+		unsigned vers, unsigned minor)
+{
+	const char *format = (minor == 0) ? "%s%c%u" : "%s%c%u.%u";
+	bool supported = !!nfsd_vers(vers, NFSD_TEST);
+
+	if (vers == 4 && !nfsd_minorversion(minor, NFSD_TEST))
+		supported = false;
+	return snprintf(buf, remaining, format, sep,
+			supported ? '+' : '-', vers, minor);
+}
+
 static ssize_t __write_versions(struct file *file, char *buf, size_t size)
 {
 	char *mesg = buf;
@@ -598,40 +611,23 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
 	len = 0;
 	sep = "";
 	remaining = SIMPLE_TRANSACTION_LIMIT;
-	for (num=2 ; num <= 4 ; num++)
-		if (nfsd_vers(num, NFSD_AVAIL)) {
-			len = snprintf(buf, remaining, "%s%c%d", sep,
-				       nfsd_vers(num, NFSD_TEST)?'+':'-',
-				       num);
-			sep = " ";
-
-			if (len >= remaining)
-				break;
-			remaining -= len;
-			buf += len;
-			tlen += len;
-		}
-	if (nfsd_vers(4, NFSD_AVAIL))
-		for (minor = 0; minor <= NFSD_SUPPORTED_MINOR_VERSION;
-		     minor++) {
-			if (minor == 0 && nfsd_minorversion(minor, NFSD_TEST))
-				/* for backward compatibility, don't report
-				 * +4.0
-				 */
-				continue;
-			len = snprintf(buf, remaining, " %c4.%u",
-					(nfsd_vers(4, NFSD_TEST) &&
-					 nfsd_minorversion(minor, NFSD_TEST)) ?
-						'+' : '-',
-					minor);
-
+	for (num=2 ; num <= 4 ; num++) {
+		if (!nfsd_vers(num, NFSD_AVAIL))
+			continue;
+		minor = 0;
+		do {
+			len = nfsd_print_version_support(buf, remaining,
+					sep, num, minor);
 			if (len >= remaining)
-				break;
+				goto out;
 			remaining -= len;
 			buf += len;
 			tlen += len;
-		}
-
+			minor++;
+			sep = " ";
+		} while (num == 4 && minor <= NFSD_SUPPORTED_MINOR_VERSION);
+	}
+out:
 	len = snprintf(buf, remaining, "\n");
 	if (len >= remaining)
 		return -EINVAL;
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0
  2017-02-22 23:35 [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0 Trond Myklebust
  2017-02-22 23:35 ` [PATCH v2 1/2] nfsd: Allow enabling NFSv4.x without also requiring NFSv4.0 Trond Myklebust
@ 2017-02-23  0:13 ` NeilBrown
  2017-02-23  1:00   ` Trond Myklebust
  1 sibling, 1 reply; 10+ messages in thread
From: NeilBrown @ 2017-02-23  0:13 UTC (permalink / raw)
  To: Trond Myklebust, bfields; +Cc: linux-nfs

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

On Wed, Feb 22 2017, Trond Myklebust wrote:

> This patch series was intended as a standalone series. However it now
> aims to fix up a few issues with Neil's initial patch:
>
> 1) When the user turns off all minor versions of NFSv4, then that should
>    be equivalent to turning off NFSv4 support, and so when someone tries
>    to mount, we should return RPC_PROG_MISMATCH.
> 2) Allow the user to use either '4.0' or '4' in order to enable or disable
>    minor version 0. Other minor versions remain enabled/disabled using the
>    '4.x' format.

If I understand you and the code correctly, then this change means that
if I run

   rpc.nfsd -N 4

the nfs server will continue to server v4.1 and v4.2 requests, only v4.0
will be disabled (Assuming a kernel which defaults to serving v4.0, v4.1
and v4.0).

Is that really what we want?

The text in the man page for rpc.nfsd could be read as allowing this
interpretation, though it isn't explicit.
I've always used "NFSv4" to mean any or all for 4.0, 4.1, 4.2, ...

Thanks,
NeilBrown


> 3) Fix up the display of the minor versions so that we don't add '4.0'.
>    Previous kernels have always assumed the '4' means 'minor version 0',
>    so there should be no need to have both.
>
> v2: Make incremental to Neil's patch
>     Fix up display of the version string
>
> Trond Myklebust (2):
>   nfsd: Allow enabling NFSv4.x without also requiring NFSv4.0
>   nfsd: Fix display of the version string
>
>  fs/nfsd/nfsctl.c | 72 ++++++++++++++++++++++++++------------------------------
>  fs/nfsd/nfssvc.c | 14 +++++++++++
>  2 files changed, 48 insertions(+), 38 deletions(-)
>
> -- 
> 2.9.3

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0
  2017-02-23  0:13 ` [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0 NeilBrown
@ 2017-02-23  1:00   ` Trond Myklebust
  2017-02-27 23:03     ` bfields
  0 siblings, 1 reply; 10+ messages in thread
From: Trond Myklebust @ 2017-02-23  1:00 UTC (permalink / raw)
  To: bfields, neilb; +Cc: linux-nfs

T24gVGh1LCAyMDE3LTAyLTIzIGF0IDExOjEzICsxMTAwLCBOZWlsQnJvd24gd3JvdGU6DQo+IE9u
IFdlZCwgRmViIDIyIDIwMTcsIFRyb25kIE15a2xlYnVzdCB3cm90ZToNCj4gDQo+ID4gVGhpcyBw
YXRjaCBzZXJpZXMgd2FzIGludGVuZGVkIGFzIGEgc3RhbmRhbG9uZSBzZXJpZXMuIEhvd2V2ZXIg
aXQNCj4gPiBub3cNCj4gPiBhaW1zIHRvIGZpeCB1cCBhIGZldyBpc3N1ZXMgd2l0aCBOZWlsJ3Mg
aW5pdGlhbCBwYXRjaDoNCj4gPiANCj4gPiAxKSBXaGVuIHRoZSB1c2VyIHR1cm5zIG9mZiBhbGwg
bWlub3IgdmVyc2lvbnMgb2YgTkZTdjQsIHRoZW4gdGhhdA0KPiA+IHNob3VsZA0KPiA+IMKgwqDC
oGJlIGVxdWl2YWxlbnQgdG8gdHVybmluZyBvZmYgTkZTdjQgc3VwcG9ydCwgYW5kIHNvIHdoZW4g
c29tZW9uZQ0KPiA+IHRyaWVzDQo+ID4gwqDCoMKgdG8gbW91bnQsIHdlIHNob3VsZCByZXR1cm4g
UlBDX1BST0dfTUlTTUFUQ0gu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csDQo+ID4gwqDCoMKgc28gdGhlcmUgc2hvdWxkIGJlIG5v
IG5lZWQgdG8gaGF2ZSBib3RoLg0KPiA+IA0KPiA+IHYyOiBNYWtlIGluY3JlbWVudGFsIHRvIE5l
aWwncyBwYXRjaA0KPiA+IMKgwqDCoMKgRml4IHVwIGRpc3BsYXkgb2YgdGhlIHZlcnNpb24gc3Ry
aW5nDQo+ID4gDQo+ID4gVHJvbmQgTXlrbGVidXN0ICgyKToNCj4gPiDCoCBuZnNkOiBBbGxvdyBl
bmFibGluZyBORlN2NC54IHdpdGhvdXQgYWxzbyByZXF1aXJpbmcgTkZTdjQuMA0KPiA+IMKgIG5m
c2Q6IEZpeCBkaXNwbGF5IG9mIHRoZSB2ZXJzaW9uIHN0cmluZw0KPiA+IA0KPiA+IMKgZnMvbmZz
ZC9uZnNjdGwuYyB8IDcyICsrKysrKysrKysrKysrKysrKysrKysrKysrLS0tLS0tLS0tLS0tLS0t
LQ0KPiA+IC0tLS0tLS0tLS0tLS0tDQo+ID4gwqBmcy9uZnNkL25mc3N2Yy5jIHwgMTQgKysrKysr
KysrKysNCj4gPiDCoDIgZmlsZXMgY2hhbmdlZCwgNDggaW5zZXJ0aW9ucygrKSwgMzggZGVsZXRp
b25zKC0pDQo+ID4gDQo+ID4gLS3CoA0KPiA+IDIuOS4zDQotLSANClRyb25kIE15a2xlYnVzdA0K
TGludXggTkZTIGNsaWVudCBtYWludGFpbmVyLCBQcmltYXJ5RGF0YQ0KdHJvbmQubXlrbGVidXN0
QHByaW1hcnlkYXRhLmNvbQ0K


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0
  2017-02-23  1:00   ` Trond Myklebust
@ 2017-02-27 23:03     ` bfields
  2017-03-02 22:57       ` NeilBrown
  0 siblings, 1 reply; 10+ messages in thread
From: bfields @ 2017-02-27 23:03 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: neilb, linux-nfs

On Thu, Feb 23, 2017 at 01:00:12AM +0000, Trond Myklebust wrote:
> On Thu, 2017-02-23 at 11:13 +1100, NeilBrown wrote:
> > On Wed, Feb 22 2017, Trond Myklebust wrote:
> > 
> > > This patch series was intended as a standalone series. However it
> > > now
> > > aims to fix up a few issues with Neil's initial patch:
> > > 
> > > 1) When the user turns off all minor versions of NFSv4, then that
> > > should
> > >    be equivalent to turning off NFSv4 support, and so when someone
> > > tries
> > >    to mount, we should return RPC_PROG_MISMATCH.
> > > 2) Allow the user to use either '4.0' or '4' in order to enable or
> > > disable
> > >    minor version 0. Other minor versions remain enabled/disabled
> > > using the
> > >    '4.x' format.
> > 
> > If I understand you and the code correctly, then this change means
> > that
> > if I run
> > 
> >    rpc.nfsd -N 4
> > 
> > the nfs server will continue to server v4.1 and v4.2 requests, only
> > v4.0
> > will be disabled (Assuming a kernel which defaults to serving v4.0,
> > v4.1
> > and v4.0).
> 
> Unfortunately not... The problem is that rpc.nfsd has a borken parser
> that refuses the '-N4 -V4.2' syntax, and that throws hissy fit if you
> try to feed it '-N4.0' or '-V4.0'.
> 
> The kernel change needs to be accompanied by a fix to nfs-utils.
> 
> > Is that really what we want?
> > 
> > The text in the man page for rpc.nfsd could be read as allowing this
> > interpretation, though it isn't explicit.
> > I've always used "NFSv4" to mean any or all for 4.0, 4.1, 4.2, ...
> 
> We _could_ do that. As I said, that's a question of fixing rpc.nfsd.
> 
> The question here, though, is what should the kernel do when you start
> poking into /proc/fs/nfsd/versions. I think adding a new field between
> '4' and '4.0' might be more disruptive than changing the meaning of '4'
> to mean '4.0' as there might be other parsers of that pseudofile out
> there today.

I'm OK with that, unless Neil sees a problem.

The changelog on the first patch doesn't seem to describe the v2 version
very well; using the below cribbed from your cover letter instead.

    nfsd: fix configuration of supported minor versions
    
    When the user turns off all minor versions of NFSv4, that should be
    equivalent to turning off NFSv4 support, so a mount attempt using NFSv4
    should get RPC_PROG_MISMATCH, not NFSERR_MINOR_VERS_MISMATCH.
    
    Allow the user to use either '4.0' or '4' to enable or disable minor
    version 0.  Other minor versions are still enabled or disabled using the
    '4.x' format.

--b.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0
  2017-02-27 23:03     ` bfields
@ 2017-03-02 22:57       ` NeilBrown
  2017-03-04 18:55         ` Trond Myklebust
  0 siblings, 1 reply; 10+ messages in thread
From: NeilBrown @ 2017-03-02 22:57 UTC (permalink / raw)
  To: bfields, Trond Myklebust; +Cc: linux-nfs

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

On Mon, Feb 27 2017, bfields@fieldses.org wrote:

> On Thu, Feb 23, 2017 at 01:00:12AM +0000, Trond Myklebust wrote:
>> On Thu, 2017-02-23 at 11:13 +1100, NeilBrown wrote:
>> > On Wed, Feb 22 2017, Trond Myklebust wrote:
>> > 
>> > > This patch series was intended as a standalone series. However it
>> > > now
>> > > aims to fix up a few issues with Neil's initial patch:
>> > > 
>> > > 1) When the user turns off all minor versions of NFSv4, then that
>> > > should
>> > >    be equivalent to turning off NFSv4 support, and so when someone
>> > > tries
>> > >    to mount, we should return RPC_PROG_MISMATCH.
>> > > 2) Allow the user to use either '4.0' or '4' in order to enable or
>> > > disable
>> > >    minor version 0. Other minor versions remain enabled/disabled
>> > > using the
>> > >    '4.x' format.
>> > 
>> > If I understand you and the code correctly, then this change means
>> > that
>> > if I run
>> > 
>> >    rpc.nfsd -N 4
>> > 
>> > the nfs server will continue to server v4.1 and v4.2 requests, only
>> > v4.0
>> > will be disabled (Assuming a kernel which defaults to serving v4.0,
>> > v4.1
>> > and v4.0).
>> 
>> Unfortunately not... The problem is that rpc.nfsd has a borken parser
>> that refuses the '-N4 -V4.2' syntax, and that throws hissy fit if you
>> try to feed it '-N4.0' or '-V4.0'.
>> 
>> The kernel change needs to be accompanied by a fix to nfs-utils.
>> 
>> > Is that really what we want?
>> > 
>> > The text in the man page for rpc.nfsd could be read as allowing this
>> > interpretation, though it isn't explicit.
>> > I've always used "NFSv4" to mean any or all for 4.0, 4.1, 4.2, ...
>> 
>> We _could_ do that. As I said, that's a question of fixing rpc.nfsd.
>> 
>> The question here, though, is what should the kernel do when you start
>> poking into /proc/fs/nfsd/versions. I think adding a new field between
>> '4' and '4.0' might be more disruptive than changing the meaning of '4'
>> to mean '4.0' as there might be other parsers of that pseudofile out
>> there today.
>
> I'm OK with that, unless Neil sees a problem.

I don't know ... the more I think about it, the less certain I seem to
be.

Prior to Trond's updates for nfs-utils, "rpc.nfsd -N 4" would write
 "+3 -4"
to the 'versions' file, which will currently disable NFSv4 completely.
With this patch it will disable 4.0, but leave 4.1 active.

This behavior is consistent with the documentation, which says:

   The  current version of rpc.nfsd can support major NFS versions 2,3,4
   and the minor versions 4.1 and 4.2.

which suggests that "4.1" is a different thing to "4", not part of it.
And the current nfs-utils doesn't support disabling just 4.0 at all.
You cannot say "rpc.nfsd -N 4.0".
So this patch gives more control to the old nfs-utils, by changing the
semantics of a particular operation.

Technically, it is a regression though.  It does result in a more
coherent interface, which is a good thing in the long term.

When you read from "versions" you get the major version and minor
version listed separately, with a special case that "+4.0" is never
reported.
So if just 4.1 is enabled, you might get
   -3 +4 -4.0 +4.1 -4.2

after Trond's change "4" means "4.0" and "4.0" is never displayed,
so the above case would become
   -3 -4 +4.1 -4.2

which is very different.  Probably another regression.

I guess I'm not entirely sure what Trond is trying to fix.
This bit:

1) When the user turns off all minor versions of NFSv4, then that should
   be equivalent to turning off NFSv4 support, and so when someone tries
   to mount, we should return RPC_PROG_MISMATCH.

Makes perfect sense.  But I'm not clear on why the format of the
versions file needs to change.
Trond - what am I missing?

Thanks,
NeilBrown



>
> The changelog on the first patch doesn't seem to describe the v2 version
> very well; using the below cribbed from your cover letter instead.
>
>     nfsd: fix configuration of supported minor versions
>     
>     When the user turns off all minor versions of NFSv4, that should be
>     equivalent to turning off NFSv4 support, so a mount attempt using NFSv4
>     should get RPC_PROG_MISMATCH, not NFSERR_MINOR_VERS_MISMATCH.
>     
>     Allow the user to use either '4.0' or '4' to enable or disable minor
>     version 0.  Other minor versions are still enabled or disabled using the
>     '4.x' format.
>
> --b.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0
  2017-03-02 22:57       ` NeilBrown
@ 2017-03-04 18:55         ` Trond Myklebust
  2017-03-06  4:26           ` NeilBrown
  0 siblings, 1 reply; 10+ messages in thread
From: Trond Myklebust @ 2017-03-04 18:55 UTC (permalink / raw)
  To: bfields, neilb; +Cc: linux-nfs

T24gRnJpLCAyMDE3LTAzLTAzIGF0IDA5OjU3ICsxMTAwLCBOZWlsQnJvd24gd3JvdGU6DQo+IE9u
IE1vbiwgRmViIDI3IDIwMTcsIGJmaWVsZHNAZmllbGRzZXMub3JnIHdyb3RlOg0KPiANCj4gPiBP
biBUaHUsIEZlYiAyMywgMjAxNyBhdCAwMTowMDoxMkFNICswMDAwLCBUcm9uZCBNeWtsZWJ1c3Qg
d3JvdGU6DQo+ID4gPiBPbiBUaHUsIDIwMTctMDItMjMgYXQgMTE6MTMgKzExMDAsIE5laWxCcm93
biB3cm90ZToNCj4gPiA+ID4gT24gV2VkLCBGZWIgMjIgMjAxNywgVHJvbmQgTXlrbGVidXN0IHdy
b3RlOg0KPiA+ID4gPiANCj4gPiA+ID4gPiBUaGlzIHBhdGNoIHNlcmllcyB3YXMgaW50ZW5kZWQg
YXMgYSBzdGFuZGFsb25lIHNlcmllcy4NCj4gPiA+ID4gPiBIb3dldmVyIGl0DQo+ID4gPiA+ID4g
bm93DQo+ID4gPiA+ID4gYWltcyB0byBmaXggdXAgYSBmZXcgaXNzdWVzIHdpdGggTmVpbCdzIGlu
aXRpYWwgcGF0Y2g6DQo+ID4gPiA+ID4gDQo+ID4gPiA+ID4gMSkgV2hlbiB0aGUgdXNlciB0dXJu
cyBvZmYgYWxsIG1pbm9yIHZlcn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xsIG1pbm9yIHZlcnNpb25z
IG9mIE5GU3Y0LCB0aGF0DQo+ID4gc2hvdWxkIGJlDQo+ID4gwqDCoMKgwqBlcXVpdmFsZW50IHRv
IHR1cm5pbmcgb2ZmIE5GU3Y0IHN1cHBvcnQsIHNvIGEgbW91bnQgYXR0ZW1wdA0KPiA+IHVzaW5n
IE5GU3Y0DQo+ID4gwqDCoMKgwqBzaG91bGQgZ2V0IFJQQ19QUk9HX01JU01BVENILCBub3QgTkZT
RVJSX01JTk9SX1ZFUlNfTUlTTUFUQ0guDQo+ID4gwqDCoMKgwqANCj4gPiDCoMKgwqDCoEFsbG93
IHRoZSB1c2VyIHRvIHVzZSBlaXRoZXIgJzQuMCcgb3IgJzQnIHRvIGVuYWJsZSBvciBkaXNhYmxl
DQo+ID4gbWlub3INCj4gPiDCoMKgwqDCoHZlcnNpb24gMC7CoMKgT3RoZXIgbWlub3IgdmVyc2lv
bnMgYXJlIHN0aWxsIGVuYWJsZWQgb3IgZGlzYWJsZWQNCj4gPiB1c2luZyB0aGUNCj4gPiDCoMKg
wqDCoCc0LngnIGZvcm1hdC4NCj4gPiANCj4gPiAtLWIuDQotLSANClRyb25kIE15a2xlYnVzdA0K
TGludXggTkZTIGNsaWVudCBtYWludGFpbmVyLCBQcmltYXJ5RGF0YQ0KdHJvbmQubXlrbGVidXN0
QHByaW1hcnlkYXRhLmNvbQ0K


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0
  2017-03-04 18:55         ` Trond Myklebust
@ 2017-03-06  4:26           ` NeilBrown
  2017-03-09 20:51             ` bfields
  0 siblings, 1 reply; 10+ messages in thread
From: NeilBrown @ 2017-03-06  4:26 UTC (permalink / raw)
  To: Trond Myklebust, bfields; +Cc: linux-nfs

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

On Sat, Mar 04 2017, Trond Myklebust wrote:

> On Fri, 2017-03-03 at 09:57 +1100, NeilBrown wrote:
>> I guess I'm not entirely sure what Trond is trying to fix.
>> This bit:
>> 
>> 1) When the user turns off all minor versions of NFSv4, then that
>> should
>>    be equivalent to turning off NFSv4 support, and so when someone
>> tries
>>    to mount, we should return RPC_PROG_MISMATCH.
>> 
>> Makes perfect sense.  But I'm not clear on why the format of the
>> versions file needs to change.
>> Trond - what am I missing?
>>

Thanks for the details!!


>
> The main issue that worried me was one of predictability. What is
> supposed to happen when you type "echo +4"? One thing that I considered
> to be a regression, was that previously, I could expect that "echo +4"
> would at the very least turn on NFSv4 minor version 0, but with the
> change to semantics, it would only do so if nobody had typed "echo
> -4.0".

I don't think I would consider this as a regression.
Prior to

Commit: e35659f1b03c ("NFSD: correctly range-check v4.x minor version when setting versions.")

"echo -4.0" would result in an error.  After that patch it will result in
behaviour that you think is inconsistent.  While that might be a poor
design choice, I don't think it is a regression because it is not
(holistically) something that worked before and now works differently.

I agree that "echo +4" should do something sensible and predictable.  I
would like to suggest that it should enable all "supported" NFSv4.x minor
versions.  That is consistent with how rpc.nfsd uses it, and makes sense
to me. "echo -4" should disable all minor versions.

>
> An analogy would be putting 2 light switches in front of a light bulb,
> so that unless both switches are on, the bulb will not turn on.
> Actually, it is worse than that, because none of the bulbs turn on
> until you start up knfsd (so you can argue that there is a third switch
> in front of the other two).
> Why do we need this many levels of switches in a kernel interface? You
> should be able to achieve the same functionality by just turning on and
> off the individual minor versions. The right place for designing more
> complex interfaces would be userspace, and is exactly what the rpc.nfsd
> utility should be taking care of.

The "no regressions" rule can often lead to clunky interfaces.  It
certainly isn't ideal, but sometimes we need to live with it.
The right place to hide that clunkiness is in rpc.nfsd :-)

>
> Finally, there is the issue that the interface allowed situations where
> knfsd was advertising support for NFSv4 via rpcbind, but there were no
> minor versions enabled, and so you'd just get a confusing series of
> NFS4ERR_MINOR_VERSION_MISMATCH replies when attempting to mount. Why
> even advertise support in that case?

I agree with this.
If all minor versions are disabled, the major version should be disabled
as well.  If any minor versions are enabled, the major version must be
enabled too.

Thanks,
NeilBrown

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0
  2017-03-06  4:26           ` NeilBrown
@ 2017-03-09 20:51             ` bfields
  0 siblings, 0 replies; 10+ messages in thread
From: bfields @ 2017-03-09 20:51 UTC (permalink / raw)
  To: NeilBrown; +Cc: Trond Myklebust, linux-nfs

Sorry for not paying close attention here.  Catching up:

On Mon, Mar 06, 2017 at 03:26:40PM +1100, NeilBrown wrote:
> On Sat, Mar 04 2017, Trond Myklebust wrote:
> 
> > The main issue that worried me was one of predictability. What is
> > supposed to happen when you type "echo +4"? One thing that I considered
> > to be a regression, was that previously, I could expect that "echo +4"
> > would at the very least turn on NFSv4 minor version 0, but with the
> > change to semantics, it would only do so if nobody had typed "echo
> > -4.0".
> 
> I don't think I would consider this as a regression. Prior to
> 
> Commit: e35659f1b03c ("NFSD: correctly range-check v4.x minor version when setting versions.")
> 
> "echo -4.0" would result in an error.  After that patch it will result in
> behaviour that you think is inconsistent.  While that might be a poor
> design choice, I don't think it is a regression because it is not
> (holistically) something that worked before and now works differently.
>
> I agree that "echo +4" should do something sensible and predictable.  I
> would like to suggest that it should enable all "supported" NFSv4.x minor
> versions.  That is consistent with how rpc.nfsd uses it, and makes sense
> to me. "echo -4" should disable all minor versions.
> 
> >
> > An analogy would be putting 2 light switches in front of a light bulb,
> > so that unless both switches are on, the bulb will not turn on.
> > Actually, it is worse than that, because none of the bulbs turn on
> > until you start up knfsd (so you can argue that there is a third switch
> > in front of the other two).
> > Why do we need this many levels of switches in a kernel interface? You
> > should be able to achieve the same functionality by just turning on and
> > off the individual minor versions. The right place for designing more
> > complex interfaces would be userspace, and is exactly what the rpc.nfsd
> > utility should be taking care of.
> 
> The "no regressions" rule can often lead to clunky interfaces.  It
> certainly isn't ideal, but sometimes we need to live with it.
> The right place to hide that clunkiness is in rpc.nfsd :-)

That sounds right to me.

> > Finally, there is the issue that the interface allowed situations where
> > knfsd was advertising support for NFSv4 via rpcbind, but there were no
> > minor versions enabled, and so you'd just get a confusing series of
> > NFS4ERR_MINOR_VERSION_MISMATCH replies when attempting to mount. Why
> > even advertise support in that case?
> 
> I agree with this.
> If all minor versions are disabled, the major version should be disabled
> as well.  If any minor versions are enabled, the major version must be
> enabled too.

So, if you have a patch that keeps the agreed-on change while reverting
to a (clunkier, but more backwards-compatible) interface, and if you can
do it while we're still early in 4.11, then I'd take that.

--b.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-03-09 20:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-22 23:35 [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0 Trond Myklebust
2017-02-22 23:35 ` [PATCH v2 1/2] nfsd: Allow enabling NFSv4.x without also requiring NFSv4.0 Trond Myklebust
2017-02-22 23:35   ` [PATCH v2 2/2] nfsd: Fix display of the version string Trond Myklebust
2017-02-23  0:13 ` [PATCH v2 0/2] Fix up nfsd to enable NFSv4.x without NFSv4.0 NeilBrown
2017-02-23  1:00   ` Trond Myklebust
2017-02-27 23:03     ` bfields
2017-03-02 22:57       ` NeilBrown
2017-03-04 18:55         ` Trond Myklebust
2017-03-06  4:26           ` NeilBrown
2017-03-09 20:51             ` bfields

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.