Skip to contentSkip to conversation

mount: Added the -o v4.1 mount option

RFC PATCH In review Steve Dickson 4 participants 14 messages Nov 19, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH v2 1/1 mount: Added the -o v4.1 mount option

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.

---
 utils/mount/network.c | 18 ++++++++++++++++--
 utils/mount/nfs.man   | 13 +++++++++++++
 2 files changed, 29 insertions(+), 2 deletions(-)
utils/mount/network.c +16 -2
index e7bd522..36aa03b 100644
@@ -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;
utils/mount/nfs.man +13 -0
index c15de98..8d1bb56 100644
@@ -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
Signature · 1 line
1.7.11.7
#1 lore raw

T24gTW9uLCAyMDEyLTExLTE5IGF0IDEwOjQzIC0wNTAwLCBTdGV2ZSBEaWNrc29uIHdyb3RlOg0K PiBUaGlzIHBhdGNoIHdpbGwgY29udmVydCAtbyB2NC4xLCB2ZXJzPTQuMSBvciBuZnN2ZXJzPTQu MSBpbnRvDQo+IHRoZSBjb3JyZXNwb25kaW5nICJ2NCxtaW5vcnZlcnNpb249MSIsICJ2ZXJzPTQs bWlub3J2ZXJzaW9uPTEiDQo+IG9yICJuZnN2ZXJzPTQsbWlub3J2ZXJzaW9uPTEiIG9wdGlvbnMu DQo+IA0KDQpOQUNLLg0KDQpJZiB5b3UgYXJlIGdvaW5nIHRvIGRvIHRoaXMsIHRoZW4gcGxlYXNl IGRvIGl0IG9ubHkgZm9yIGtlcm5lbHMgdGhhdA0KZG9uJ3Qgc3VwcG9ydCB0aGUgInZlcnM9NC4x IiBzeW50YXguIGkuZS4gYW55dGhpbmcgb2xkZXIgdGhhbiBMaW51eC0zLjQuDQoNCldlIHdhbnQg dG8gZ2V0IHJpZCBvZiBtaW5vcnZlcnNpb249eCwgbm90IHBlcnBldHVhdGUgaXQuLi4NCg0KLS0g DQpUcm9uZCBNeWtsZWJ1c3QNCkxpbnV4IE5GUyBjbGllbnQgbWFpbnRhaW5lcg0KDQpOZXRBcHAN ClRyb25kLk15a2xlYnVzdEBuZXRhcHAuY29tDQp3d3cubmV0YXBwLmNvbQ0K

#2 lore raw
Quoted 10 lines · Trond
Quoted 4 lines · Steve Dickson

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.

NACK.

If you are going to do this, then please do it only for kernels that don't support the "vers=4.1" syntax. i.e. anything older than Linux-3.4.

This is the intention...

Quoted 3 lines

We want to get rid of minorversion=x, not perpetuate it...

Understood... But that is not option in some worlds... ;-)

steved.

#3 lore raw

T24gTW9uLCAyMDEyLTExLTE5IGF0IDEwOjU4IC0wNTAwLCBTdGV2ZSBEaWNrc29uIHdyb3RlOg0K PiANCj4gT24gMTkvMTEvMTIgMTA6NTQsIE15a2xlYnVzdCwgVHJvbmQgd3JvdGU6DQo+ID4gT24g TW9uLCAyMDEyLTExLTE5IGF0IDEwOjQzIC0wNTAwLCBTdGV2ZSBEaWNrc29uIHdyb3RlOg0KPiA+ PiBUaGlzIHBhdGNoIHdpbGwgY29udmVydCAtbyB2NC4xLCB2ZXJzPTQuMSBvciBuZnN2ZXJzPTQu MSBpbnRvDQo+ID4+IHRoZSBjb3JyZXNwb25kaW5nICJ2NCxtaW5vcnZlcnNpb249MSIsICJ2ZXJz PTQsbWlub3J2ZXJzaW9uPTEiDQo+ID4+IG9yICJuZnN2ZXJzPTQsbWlub3J2ZXJzaW9uPTEiIG9w dGlvbnMuDQo+ID4+DQo+ID4gDQo+ID4gTkFDSy4NCj4gPiANCj4gPiBJZiB5b3UgYXJlIGdvaW5n IHRvIGRvIHRoaXMsIHRoZW4gcGxlYXNlIGRvIGl0IG9ubHkgZm9yIGtlcm5lbHMgdGhhdA0KPiA+ IGRvbid0IHN1cHBvcnQgdGhlICJ2ZXJzPTQuMSIgc3ludGF4LiBpLmUuIGFueXRoaW5nIG9sZGVy IHRoYW4gTGludXgtMy40Lg0KPiBUaGlzIGlzIHRoZSBpbnRlbnRpb24uLi4gDQo+IA0KPiA+IA0K PiA+IFdlIHdhbnQgdG8gZ2V0IHJpZCBvZiBtaW5vcnZlcnNpb249eCwgbm90IHBlcnBldHVhdGUg aXQuLi4NCj4gPiANCj4gVW5kZXJzdG9vZC4uLiBCdXQgdGhhdCBpcyBub3Qgb3B0aW9uIGluIHNv bWUgd29ybGRzLi4uIDstKSANCg0KU3VyZSBpdCBpcy4gVGhlIG1vdW50IHByb2dyYW0gY2FuIGNv bnRpbnVlIHRvIHBhcnNlIG1pbm9ydmVyc2lvbj0gYWZ0ZXINCml0IGlzIGdvbmUgZnJvbSB0aGUg a2VybmVsIGFuZCBjb252ZXJ0IGl0IGludG8gdGhlIHZlcnM9NC54IHN5bnRheC4NCg0KLS0gDQpU cm9uZCBNeWtsZWJ1c3QNCkxpbnV4IE5GUyBjbGllbnQgbWFpbnRhaW5lcg0KDQpOZXRBcHANClRy b25kLk15a2xlYnVzdEBuZXRhcHAuY29tDQp3d3cubmV0YXBwLmNvbQ0K

#4 lore raw
Quoted 16 lines · Trond
Quoted 15 lines · Steve Dickson
Quoted 10 lines · Trond
Quoted 4 lines · Steve Dickson

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.

NACK.

If you are going to do this, then please do it only for kernels that don't support the "vers=4.1" syntax. i.e. anything older than Linux-3.4.

This is the intention...

Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

We want to get rid of minorversion=x, not perpetuate it...

Understood... But that is not option in some worlds... ;-)

Sure it is. The mount program can continue to parse minorversion= after it is gone from the kernel and convert it into the vers=4.x syntax.

Basically what I'm doing now, with the exception of not adding the minorversion=1 options...

BTW, there is a bug in the -o v4.1 current logic...

mount -o v4.1 produces both "v4.1,vers=4,..." in the string that given to the kernel which does not seem right... I would assume just a "v4.1,.." should be pumped down..

steved.

#5 lore raw

T24gTW9uLCAyMDEyLTExLTE5IGF0IDExOjE0IC0wNTAwLCBTdGV2ZSBEaWNrc29uIHdyb3RlOg0K PiANCj4gT24gM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SB3aWxsIHdhbnQgdG8NCmhh dmUgJ3ZlcnM9NCcgYmUgdGhlICdhdXRvLW5lZ290aWF0ZSBtaW5vciB2ZXJzaW9uJyBzeW50YXgs IHdoaWxlDQp2ZXJzPTQueCB3aWxsIGJlIHRoZSAndXNlIG1pbm9yIHZlcnNpb24geCcgc3ludGF4 Lg0KT2YgY291cnNlLCBhdXRvLW5lZ290aWF0aW9uIHNob3VsZCBiZSBkcml2ZW4gYnkgdGhlICdt b3VudCcgcHJvZ3JhbSwNCndoaWNoIHdpbGwgYmUgdXNpbmcgdGhlICd2ZXJzPTQueCcgc3ludGF4 IGluIHRoZSBtb3VudCBzeXN0ZW0gY2FsbCwgZm9yDQp2YXJpb3VzIHZhbHVlcyBvZiAneCcsIHVu dGlsIGl0IGFjaGlldmVzIHN1Y2Nlc3MuDQoNCi0tIA0KVHJvbmQgTXlrbGVidXN0DQpMaW51eCBO RlMgY2xpZW50IG1haW50YWluZXINCg0KTmV0QXBwDQpUcm9uZC5NeWtsZWJ1c3RAbmV0YXBwLmNv bQ0Kd3d3Lm5ldGFwcC5jb20NCg==

#6 lore raw
Quoted 40 lines · Trond
Quoted 25 lines · Steve Dickson
Quoted 16 lines · Trond
Quoted 15 lines · Steve Dickson
Quoted 10 lines · Trond
Quoted 4 lines · Steve Dickson

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.

NACK.

If you are going to do this, then please do it only for kernels that don't support the "vers=4.1" syntax. i.e. anything older than Linux-3.4.

This is the intention...

Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

We want to get rid of minorversion=x, not perpetuate it...

Understood... But that is not option in some worlds... ;-)

Sure it is. The mount program can continue to parse minorversion= after it is gone from the kernel and convert it into the vers=4.x syntax.

Quoted 8 lines

Basically what I'm doing now, with the exception of not adding the minorversion=1 options...

BTW, there is a bug in the -o v4.1 current logic...

mount -o v4.1 produces both "v4.1,vers=4,..." in the string that given to the kernel which does not seem right... I would assume just a "v4.1,.." should be pumped down..

Yes. I remember seeing that in the Bakeathon tests... I agree that we just need the vers=4.1. The extra 'vers=4' isn't harmful in that the kernel won't interpret it as vers=4.0, but it would be nice to get rid of it.

Quoted 6 lines

Essentially, the plan is that some time in the future we will want to have 'vers=4' be the 'auto-negotiate minor version' syntax, while vers=4.x will be the 'use minor version x' syntax.
Of course, auto-negotiation should be driven by the 'mount' program, which will be using the 'vers=4.x' syntax in the mount system call, for various values of 'x', until it achieves success.

Interesting. I assume you want "mount.nfs" to do this to allow some kind of auto-negotiation policy to be specified (say, via the mount command configuration file).

As a design precursor, can you speculate on how the mount command would go about negotiating the minor version? mount.nfs cannot use protocol versions advertised by rpcbind, for instance, and neither can a simple NULL request identify which minor versions are available on the server.

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#7 lore raw

T24gTW9uLCAyMDEyLTExLTE5IGF0IDEzOjExIC0wNTAwLCBDaHVjayBMZXZlciB3cm90ZToNCj4g T24gTm92IDE5LCAyMDEyLCBhdCAxMToyNCBBTSwgIk15a2xlYnVzdCwgVHJvbmQiIDxUcm9uZC5N eWtsZWJ1c3RAbmV0YXBwLmNvbT4gd3JvdGU6DQo+IA0KPiA+IE9uIE1vbiwgMjAxMi0xMS0xOSBh dCAxMToxNCAtMDUwMCwgU3RldmUgRGlja3NvbiB3cm90ZToNCj4gPj4gDQo+ID4+IE9uIDE5LzEx LzEyIDExOjAyLCBNeWtsZWJ1c3QsIFRyb25kIHdyb3RlOg0KPiA+Pj4gT24gTW9uLCAyMDEyLTEx LTE5IGF0IDEwOjU4IC0wNTAwLCBTdGV2ZSBEaWNrc29uIHdyb3RlOg0KPiA+Pj4+IA0KPiA+Pj4+ IE9uIDE5LzExLzEyIDEwOjU0LCBNeWtsZWJ1c3QsIFRyb25kIHdyb3RlOg0KPiA+Pj4+PiBPbiBN b24sIDIwMTItMTEtMTkgYXQgMTA6NDMgLTA1MDA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Ro ZSBzZXJ2ZXIuDQoNCk5vdGUgdGhhdCB0aGUgbW91bnQgY29tbWFuZCBzaG91bGQgaW4gYW55IGNh c2Ugbm90IGJlIHJlbHlpbmcgb24gcnBjYmluZA0KdG8gZGVjaWRlIHdoZXRoZXIgb3Igbm90IHRo ZSBzZXJ2ZXIgc3VwcG9ydHMgTkZTdjQuDQoNCkFzIGZvciBtaW5vciB2ZXJzaW9uIG5lZ290aWF0 aW9uLCBSRkMzNTMwIGFscmVhZHkgdGVsbHMgeW91IGhvdyB0byBkbw0KdGhpczogdGhlIGNsaWVu dCBoYXMgdG8gc3RhcnQgd2l0aCB0aGUgaGlnaGVzdCB2ZXJzaW9uIHRoYXQgaXQgc3VwcG9ydHMs DQphbmQgdGhlbiB3YWxrIHRoYXQgbnVtYmVyIGRvd24gdW50aWwgdGhlIHNlcnZlciBzdG9wcyBy ZXBseWluZyB3aXRoDQpORlM0RVJSX01JTk9SX1ZFUlNfTUlTTUFUQ0guDQoNCk5vdGUgdGhhdCBp ZiB5b3Ugd2FudCB0byBkbyB0aGlzIGluIHVzZXJsYW5kIGJlZm9yZSBjYWxsaW5nIHRoZSBtb3Vu dA0Kc3lzY2FsbCwgdGhlbiB0aGUgc3BlYyBkb2VzIGFsbG93IHlvdSB0byAicGluZyIgdGhlIE5G U3Y0IHNlcnZlciB3aXRoIGFuDQplbXB0eSBDT01QT1VORC4NCg0KLS0gDQpUcm9uZCBNeWtsZWJ1 c3QNCkxpbnV4IE5GUyBjbGllbnQgbWFpbnRhaW5lcg0KDQpOZXRBcHANClRyb25kLk15a2xlYnVz dEBuZXRhcHAuY29tDQp3d3cubmV0YXBwLmNvbQ0K

#8 lore raw
Quoted 60 lines · Trond
Quoted 42 lines · Chuck Lever
Quoted 40 lines · Trond
Quoted 25 lines · Steve Dickson
Quoted 16 lines · Trond
Quoted 15 lines · Steve Dickson
Quoted 10 lines · Trond
Quoted 4 lines · Steve Dickson

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.

NACK.

If you are going to do this, then please do it only for kernels that don't support the "vers=4.1" syntax. i.e. anything older than Linux-3.4.

This is the intention...

Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

We want to get rid of minorversion=x, not perpetuate it...

Understood... But that is not option in some worlds... ;-)

Sure it is. The mount program can continue to parse minorversion= after it is gone from the kernel and convert it into the vers=4.x syntax.

Quoted 8 lines

Basically what I'm doing now, with the exception of not adding the minorversion=1 options...

BTW, there is a bug in the -o v4.1 current logic...

mount -o v4.1 produces both "v4.1,vers=4,..." in the string that given to the kernel which does not seem right... I would assume just a "v4.1,.." should be pumped down..

Yes. I remember seeing that in the Bakeathon tests... I agree that we just need the vers=4.1. The extra 'vers=4' isn't harmful in that the kernel won't interpret it as vers=4.0, but it would be nice to get rid of it.

Quoted 8 lines
Quoted 6 lines

Essentially, the plan is that some time in the future we will want to have 'vers=4' be the 'auto-negotiate minor version' syntax, while vers=4.x will be the 'use minor version x' syntax.
Of course, auto-negotiation should be driven by the 'mount' program, which will be using the 'vers=4.x' syntax in the mount system call, for various values of 'x', until it achieves success.

Interesting. I assume you want "mount.nfs" to do this to allow some kind of auto-negotiation policy to be specified (say, via the mount command configuration file).

Right. I'd like to be able to set Defaultvers=4.1 in /etc/nfsmount.conf and have it work.

Quoted 1 line

As a design precursor, can you speculate on how the mount command would go about negotiating the minor version? mount.nfs cannot use protocol versions advertised by rpcbind, for instance, and neither can a simple NULL request identify which minor versions are available on the server.

Note that the mount command should in any case not be relying on rpcbind to decide whether or not the server supports NFSv4.

Quoted 8 lines

As for minor version negotiation, RFC3530 already tells you how to do
this: the client has to start with the highest version that it supports, and then walk that number down until the server stops replying with NFS4ERR_MINOR_VERS_MISMATCH.

Note that if you want to do this in userland before calling the mount syscall, then the spec does allow you to "ping" the NFSv4 server with an empty COMPOUND.

I see: not an NFSv4 NULL, but an NFSv4 COMPOUND that has no operations. That carries a compound header, which would have the minor version number in it.

Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#9 lore raw

T24gTW9uLCAyMDEyLTExLTE5IGF0IDEzOjM5IC0wNTAwLCBDaHVjayBMZXZlciB3cm90ZToNCj4g T24gTm92IDE5LCAyMDEyLCBhdCAxOjI5IFBNLCAiTXlrbGVidXN0LCBUcm9uZCIgPFRyb25kLk15 a2xlYnVzdEBuZXRhcHAuY29tPiB3cm90ZToNCj4gDQo+ID4gT24gTW9uLCAyMDEyLTExLTE5IGF0 IDEzOjExIC0wNTAwLCBDaHVjayBMZXZlciB3cm90ZToNCj4gPj4gT24gTm92IDE5LCAyMDEyLCBh dCAxMToyNCBBTSwgIk15a2xlYnVzdCwgVHJvbmQiIDxUcm9uZC5NeWtsZWJ1c3RAbmV0YXBwLmNv bT4gd3JvdGU6DQo+ID4+IA0KPiA+Pj4gT24gTW9uLCAyMDEyLTExLTE5IGF0IDExOjE0IC0wNTAw LCBTdGV2ZSBEaWNrc29uIHdyb3RlOg0KPiA+Pj4+IA0KPiA+Pj4+IE9uIDE5LzExLzEyIDExOjAy LCBNeWtsZWJ1c3QsIFRyb25kIHdyb3RlOg0KPiA+Pj4+PiBPbiBNb24sIDIwMTItMTEtMTkgYXQg MTA6NTggLTA1MDAsIFN0ZXZlIERpY2tzb24gd3JvdGU6DQo+ID4+Pj4+PiANCj4gPj4+Pj4+IE9u IDE5LzExLzEyIDEwOjU0LCBNeWtsZWJ1c3QsIFRyb25kIHdyb3RlOg0KPiA+Pj4+Pj4+IE9uIE1v biwgMjAxMi0xMS0xOSBhdCAxMDo0MyAtMDUwMCwgU3RldmUgRGlja3NvbiB3cm90ZToNCj4gPj4+ Pj4+Pj4gVGhpcyBwYXRjaCB3aWxsIGNvbnZlcnQgLW8gdjQuMSwgdmVycz00LjEgb3IgbmZzdmVy cz00LjEgaW50bw0KPiA+Pj4+Pj4+PiB0aGUgY29ycmVzcG9uZGluZyAidjQsbWlub3J2ZXJzaW9u P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g YWxsb3cgdGhlIHNlcnZlciB0bw0KcmV0dXJuIHRoZSBmb2xsb3dpbmcgZXJyb3JzIGluIHRoZSBj YXNlIG9mIGFuIGVtcHR5IENPTVBPVU5EOiBORlM0X09LLA0KTkZTNEVSUl9ERUxBWSwgTkZTNEVS Ul9NSU5PUl9WRVJTX01JU01BVENIIGFuZCBORlM0RVJSX1NFUlZFUkZBVUxULg0KDQpUaGUgb3Ro ZXIgZXJyb3JzIHNob3VsZG4ndCBhcHBseSBhdCBhbGwgdG8gYSB6ZXJvLW9wIGNvbXBvdW5kDQoo TkZTNEVSUl9CQURYRFIsIE5GUzRFUlJfVE9PX01BTllfT1BTLCBORlM0RVJSX1JFUF9UT09fQklH X1RPX0NBQ0hFKSwgb3INCnNob3VsZCBvbmx5IGFwcGx5IGlmIHlvdSBoYXZlIGEgbm9uLWVtcHR5 IG9wdGlvbmFsIHRhZyBhcmd1bWVudA0KKE5GUzRFUlJfQkFEQ0hBUiwgTkZTNEVSUl9JTlZBTCwg TkZTNEVSUl9SRVBfVE9PX0JJRywNCk5GUzRFUlJfUkVRX1RPT19CSUcpLg0KDQotLSANClRyb25k IE15a2xlYnVzdA0KTGludXggTkZTIGNsaWVudCBtYWludGFpbmVyDQoNCk5ldEFwcA0KVHJvbmQu TXlrbGVidXN0QG5ldGFwcC5jb20NCnd3dy5uZXRhcHAuY29tDQo=

#10 lore raw
Quoted 17 lines · Trond
Quoted 11 lines · Chuck Lever
Quoted 8 lines · Trond

As for minor version negotiation, RFC3530 already tells you how to do
this: the client has to start with the highest version that it supports, and then walk that number down until the server stops replying with NFS4ERR_MINOR_VERS_MISMATCH.

Note that if you want to do this in userland before calling the mount syscall, then the spec does allow you to "ping" the NFSv4 server with an empty COMPOUND.

I see: not an NFSv4 NULL, but an NFSv4 COMPOUND that has no operations. That carries a compound header, which would have the minor version number in it.

Right. Section 16.2.4 of RFC5661 would appear to allow the server to return the following errors in the case of an empty COMPOUND: NFS4_OK, NFS4ERR_DELAY, NFS4ERR_MINOR_VERS_MISMATCH and NFS4ERR_SERVERFAULT.

Quoted 5 lines

The other errors shouldn't apply at all to a zero-op compound (NFS4ERR_BADXDR, NFS4ERR_TOO_MANY_OPS, NFS4ERR_REP_TOO_BIG_TO_CACHE), or should only apply if you have a non-empty optional tag argument (NFS4ERR_BADCHAR, NFS4ERR_INVAL, NFS4ERR_REP_TOO_BIG, NFS4ERR_REQ_TOO_BIG).

And, I just wanted to check because I hadn't thought about this before:
the Linux server does appear to handle 0-length compounds correctly. (And there's a 4.0 pynfs test, COMP1, which checks that a server will accept a zero-length compound, so anyone that's run pynfs should have noticed if there server doesn't.)

--b.

#11 lore raw
In reply to Myklebust, Trond
Quoted 2 lines · Trond

Note that the mount command should in any case not be relying on rpcbind to decide whether or not the server supports NFSv4.

Of course....

Quoted 5 lines

As for minor version negotiation, RFC3530 already tells you how to do
this: the client has to start with the highest version that it supports, and then walk that number down until the server stops replying with NFS4ERR_MINOR_VERS_MISMATCH.

Perfect... I think we should do *all* v4 negotiation from the mount command... It's so much acceptable to replace mount.nfs binaries than kernels...

Quoted 4 lines

Note that if you want to do this in userland before calling the mount syscall, then the spec does allow you to "ping" the NFSv4 server with an empty COMPOUND.

The type of functionality will allow us to better deal with legacy servers, IMHO..

steved.

#12 lore raw
In reply to Steve Dickson
Quoted 3 lines · Steve Dickson

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.

Quoted 89 lines

---
utils/mount/network.c | 18 ++++++++++++++++--
utils/mount/nfs.man | 13 +++++++++++++

2 files changed, 29 insertions(+), 2 deletions(-)
utils/mount/network.c +16 -2
index e7bd522..36aa03b 100644
@@ -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;
utils/mount/nfs.man +0 -0
index c15de98..8d1bb56 100644
@@ -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

utils/mount/nfs.man +12 -0
+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

Signature · 6 lines
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
#13 lore raw
Quoted 2 lines · Chuck Lever

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.

I agree... The patch I put out today was just an RFC... I just wanted to get the conversation started...

Quoted 2 lines

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.

Right, I thinking bring this type of negotiation back up to userland is the right thing to do...

Quoted 2 lines

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.

Let me digest this... I've noticed that in recent kernels that minorversion always seems to be set...

steved.