Skip to contentSkip to conversation

nfsd: Set default minor versions

PATCH In review Steve Dickson 2 participants 4 messages Apr 17, 2018 – Apr 20, 2018

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

PATCH 1/1 nfsd: Set default minor versions

Due to the way the kernel stores the supported
minor versions, when a minor is turned off,
via the -N flag, it can only turned back on
via -V flag.

The default minor values should also enable
these minor versions.

---
 support/include/nfs/nfs.h | 1 +
 utils/nfsd/nfsd.c         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
support/include/nfs/nfs.h +1 -0
index 7933ff5..b7d9e06 100644
@@ -40,6 +40,7 @@ struct nfs_fh_len {
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT) 
 
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
+#define NFSCTL_MINDEFAULT (0x7)       /* minor versions 4.1 and 4.2 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1))) 
 #define NFSCTL_MINORSET(_cltbits, _v)   ((_cltbits) |= (1 << (_v)))
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
utils/nfsd/nfsd.c +2 -2
index f41a2de..2303a5d 100644
@@ -65,8 +65,8 @@ main(int argc, char **argv)
 	int hcounter = 0;
 	struct conf_list *hosts;
 	int	socket_up = 0;
-	unsigned int minorvers = 0;
-	unsigned int minorversset = 0;
+	unsigned int minorvers = NFSCTL_MINDEFAULT;
+	unsigned int minorversset = NFSCTL_MINDEFAULT;
 	unsigned int minormask = 0;
 	unsigned int versbits = NFSCTL_VERDEFAULT;
 	unsigned int protobits = NFSCTL_PROTODEFAULT;
Signature · 1 line
2.14.3
#1 lore raw
Quoted 7 lines · Steve Dickson

Due to the way the kernel stores the supported
minor versions, when a minor is turned off,
via the -N flag, it can only turned back on
via -V flag.

The default minor values should also enable
these minor versions.

Yeah, I remember now why I didn't want this.

It means that by default if somebody installs an old kernel from the time when 4.1/4.2 support was much more experimental, then they get 4.1 and 4.2 by default.

Whereas if rpc.nfsd just doesn't touch those values then they'll get the kernel default, leaving 4.1/4.2 off on older kernels and turning them back on on newer kernels.

But, whatever, I'm not sure that was the right approach. And 4.2's been the kernel's default for 3 years now anyway.

So, ACK to the patch, thanks.

--b.

Quoted 41 lines
---
 support/include/nfs/nfs.h | 1 +
 utils/nfsd/nfsd.c         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
support/include/nfs/nfs.h +1 -0
index 7933ff5..b7d9e06 100644
@@ -40,6 +40,7 @@ struct nfs_fh_len {
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT) 
 
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
+#define NFSCTL_MINDEFAULT (0x7)       /* minor versions 4.1 and 4.2 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1))) 
 #define NFSCTL_MINORSET(_cltbits, _v)   ((_cltbits) |= (1 << (_v)))
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
utils/nfsd/nfsd.c +2 -2
index f41a2de..2303a5d 100644
@@ -65,8 +65,8 @@ main(int argc, char **argv)
 	int hcounter = 0;
 	struct conf_list *hosts;
 	int	socket_up = 0;
-	unsigned int minorvers = 0;
-	unsigned int minorversset = 0;
+	unsigned int minorvers = NFSCTL_MINDEFAULT;
+	unsigned int minorversset = NFSCTL_MINDEFAULT;
 	unsigned int minormask = 0;
 	unsigned int versbits = NFSCTL_VERDEFAULT;
 	unsigned int protobits = NFSCTL_PROTODEFAULT;
Signature · 6 lines
2.14.3

--
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
#2 lore raw
Quoted 15 lines · J. Bruce Fields
Quoted 7 lines · Steve Dickson

Due to the way the kernel stores the supported
minor versions, when a minor is turned off,
via the -N flag, it can only turned back on
via -V flag.

The default minor values should also enable
these minor versions.

Yeah, I remember now why I didn't want this.

It means that by default if somebody installs an old kernel from the time when 4.1/4.2 support was much more experimental, then they get 4.1 and 4.2 by default.

Quoted 6 lines

Whereas if rpc.nfsd just doesn't touch those values then they'll get the kernel default, leaving 4.1/4.2 off on older kernels and turning them back on on newer kernels.

But, whatever, I'm not sure that was the right approach. And 4.2's been the kernel's default for 3 years now anyway.

Just for grinds... I added the patch to send unsupported minor version to an older kernel (RHEL6)... No errors and /proc/fs/nfsd/versions had the correct info.

So it appears to be harmless...

Quoted 2 lines

So, ACK to the patch, thanks.

Thanks!

steved.

Quoted 44 lines

--b.

Quoted 41 lines
---
 support/include/nfs/nfs.h | 1 +
 utils/nfsd/nfsd.c         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
support/include/nfs/nfs.h +1 -0
index 7933ff5..b7d9e06 100644
@@ -40,6 +40,7 @@ struct nfs_fh_len {
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT) 
 
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
+#define NFSCTL_MINDEFAULT (0x7)       /* minor versions 4.1 and 4.2 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1))) 
 #define NFSCTL_MINORSET(_cltbits, _v)   ((_cltbits) |= (1 << (_v)))
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
utils/nfsd/nfsd.c +2 -2
index f41a2de..2303a5d 100644
@@ -65,8 +65,8 @@ main(int argc, char **argv)
 	int hcounter = 0;
 	struct conf_list *hosts;
 	int	socket_up = 0;
-	unsigned int minorvers = 0;
-	unsigned int minorversset = 0;
+	unsigned int minorvers = NFSCTL_MINDEFAULT;
+	unsigned int minorversset = NFSCTL_MINDEFAULT;
 	unsigned int minormask = 0;
 	unsigned int versbits = NFSCTL_VERDEFAULT;
 	unsigned int protobits = NFSCTL_PROTODEFAULT;
Signature · 6 lines
2.14.3

--
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
#3 lore raw
In reply to Steve Dickson
Quoted 9 lines · Steve Dickson

Due to the way the kernel stores the supported
minor versions, when a minor is turned off,
via the -N flag, it can only turned back on
via -V flag.

The default minor values should also enable
these minor versions.

Committed...

steved.

Quoted 33 lines
---
 support/include/nfs/nfs.h | 1 +
 utils/nfsd/nfsd.c         | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
support/include/nfs/nfs.h +1 -0
index 7933ff5..b7d9e06 100644
@@ -40,6 +40,7 @@ struct nfs_fh_len {
 #define NFSCTL_TCPISSET(_cltbits)     ((_cltbits) & NFSCTL_TCPBIT) 
 
 #define NFSCTL_VERDEFAULT (0xc)       /* versions 3 and 4 */
+#define NFSCTL_MINDEFAULT (0x7)       /* minor versions 4.1 and 4.2 */
 #define NFSCTL_VERSET(_cltbits, _v)   ((_cltbits) |= (1 << ((_v) - 1))) 
 #define NFSCTL_MINORSET(_cltbits, _v)   ((_cltbits) |= (1 << (_v)))
 #define NFSCTL_UDPSET(_cltbits)       ((_cltbits) |= NFSCTL_UDPBIT)
utils/nfsd/nfsd.c +2 -2
index f41a2de..2303a5d 100644
@@ -65,8 +65,8 @@ main(int argc, char **argv)
 	int hcounter = 0;
 	struct conf_list *hosts;
 	int	socket_up = 0;
-	unsigned int minorvers = 0;
-	unsigned int minorversset = 0;
+	unsigned int minorvers = NFSCTL_MINDEFAULT;
+	unsigned int minorversset = NFSCTL_MINDEFAULT;
 	unsigned int minormask = 0;
 	unsigned int versbits = NFSCTL_VERDEFAULT;
 	unsigned int protobits = NFSCTL_PROTODEFAULT;