Skip to contentSkip to conversation

nfs-utils-1.2.9 does not play well with linux 3.10.x

PATCH In review Joakim Tjernlund 3 participants 14 messages Dec 16, 2013 – Jan 9, 2014

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

rpc.nfsd insists on adding "-4.2" when writing /proc/fs/nfsd/versions :
rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4
Which causes Linux to return an EIVAL error as 3.10 has no support for 4.2 and
does not accept any reference to 4.2

It seems reasonable to me that Linux should accpect -4.2 as a noop and continue
processing the rest of the options but I am just guessing. Anyhow, just to test I applied this commit to my 3.10.24 kernel:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc33ed5bd9fbaa243bda6fdccb22674aed6305
and now it accepts the "-4.2" but I have no idea if this messes up something else.
Ideas?

Jocke

#1 lore raw
Quoted 6 lines · Joakim Tjernlund

rpc.nfsd insists on adding "-4.2" when writing /proc/fs/nfsd/versions :
rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4
Which causes Linux to return an EIVAL error as 3.10 has no support for 4.2 and
does not accept any reference to 4.2

Quoted 8 lines

It seems reasonable to me that Linux should accpect -4.2 as a noop and continue
processing the rest of the options but I am just guessing. Anyhow, just to test I applied this commit to my 3.10.24 kernel:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc33ed5bd9fbaa243bda6fdccb22674aed6305
and now it accepts the "-4.2" but I have no idea if this messes up something else.

That should be perfectly safe.

I agree that we should teach the kernel to treat "-4.x" at least as a no-op for unknown .x. But nfs-utils also has to keep working with older kernels which don't do that.

The problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server support with the -V option". That should be using an array of ints not a bit array, so it can make the distinction between "off", "on", and "don't care".

--b.

#2 lore raw
Quoted 18 lines · bfields
Quoted 6 lines · Joakim Tjernlund

rpc.nfsd insists on adding "-4.2" when writing /proc/fs/nfsd/versions :
rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4
Which causes Linux to return an EIVAL error as 3.10 has no support for 4.2 and
does not accept any reference to 4.2

Quoted 8 lines

It seems reasonable to me that Linux should accpect -4.2 as a noop and continue
processing the rest of the options but I am just guessing. Anyhow, just to test I applied this commit to my 3.10.24 kernel:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc33ed5bd9fbaa243bda6fdccb22674aed6305
and now it accepts the "-4.2" but I have no idea if this messes up something else.

That should be perfectly safe.

Quoted 8 lines

I agree that we should teach the kernel to treat "-4.x" at least as a no-op for unknown .x. But nfs-utils also has to keep working with older kernels which don't do that.

The problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server support with the -V option". That should be using an array of ints not a bit array, so it can make the distinction between "off", "on", and "don't care".

So, something like this (untested).--b.

support/include/nfs/nfs.h +0 -1
index 38db5b5..df4ad76 100644
@@ -17,7 +17,6 @@
 
 #define NFS4_MINMINOR 1
 #define NFS4_MAXMINOR 2
-#define NFS4_VERDEFAULT  0x1  /* minor verion 1 */
 
 struct nfs_fh_len {
 	int		fh_size;
utils/nfsd/nfsd.c +3 -3
index 6db92f0..a9d77ab 100644
@@ -99,7 +99,7 @@ main(int argc, char **argv)
 	char *p, *progname, *port;
 	char *haddr = NULL;
 	int	socket_up = 0;
-	int minorvers = NFS4_VERDEFAULT;	/* nfsv4 minor version */
+	int minorvers[NFS4_MAXMINOR + 1] = {0};
 	unsigned int versbits = NFSCTL_VERDEFAULT;
 	unsigned int protobits = NFSCTL_ALLBITS;
 	unsigned int proto4 = 0;
@@ -164,7 +164,7 @@ main(int argc, char **argv)
 						fprintf(stderr, "%s: unsupported minor version\n", optarg);
 						exit(1);
 					}
-					NFSCTL_VERUNSET(minorvers, i);
+					minorvers[i] = -1;
 					break;
 				}
 			case 3:
@@ -185,7 +185,7 @@ main(int argc, char **argv)
 						fprintf(stderr, "%s: unsupported minor version\n", optarg);
 						exit(1);
 					}
-					NFSCTL_VERSET(minorvers, i);
+					minorvers[i] = 1;
 					break;
 				}
 			case 3:
utils/nfsd/nfssvc.c +3 -3
index 8b85846..1b50aba 100644
@@ -269,7 +269,7 @@ nfssvc_set_sockets(const int family, const unsigned int protobits,
 }
 
 void
-nfssvc_setvers(unsigned int ctlbits, int minorvers)
+nfssvc_setvers(unsigned int ctlbits, int minorvers[])
 {
 	int fd, n, off;
 	char *ptr;
@@ -281,9 +281,9 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers)
 		return;
 
 	for (n = NFS4_MINMINOR; n <= NFS4_MAXMINOR; n++) {
-		if (NFSCTL_VERISSET(minorvers, n)) 
+		if (minorvers[n] == 1)
 			off += snprintf(ptr+off, sizeof(buf) - off, "+4.%d ", n);
-		else			
+		else if (minorvers[n] == -1)
 			off += snprintf(ptr+off, sizeof(buf) - off, "-4.%d ", n);
 	}
 	for (n = NFSD_MINVERS; n <= NFSD_MAXVERS; n++) {
utils/nfsd/nfssvc.h +1 -1
index 08de0fe..2bbd3d3 100644
@@ -24,5 +24,5 @@ void	nfssvc_mount_nfsdfs(char *progname);
 int	nfssvc_inuse(void);
 int	nfssvc_set_sockets(const int family, const unsigned int protobits,
 			   const char *host, const char *port);
-void	nfssvc_setvers(unsigned int ctlbits, int minorvers4);
+void	nfssvc_setvers(unsigned int ctlbits, int minorvers4[]);
 int	nfssvc_threads(unsigned short port, int nrservs);
#3 lore raw

"J. Bruce Fields" <[email protected]> wrote on 2013/12/16 21:03:01:

Quoted 9 lines

From: "J. Bruce Fields" <[email protected]>
To: Joakim Tjernlund <[email protected]>,
Cc: [email protected], [email protected]
Date: 2013/12/16 21:03
Subject: Re: nfs-utils-1.2.9 does not play well with linux 3.10.x

Quoted 2 lines · bfields
Quoted 1 line · Joakim Tjernlund

rpc.nfsd insists on adding "-4.2" when writing

/proc/fs/nfsd/versions :

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4
Which causes Linux to return an EIVAL error as 3.10 has no support

for 4.2

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

and
does not accept any reference to 4.2

It seems reasonable to me that Linux should accpect -4.2 as a noop

and

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

continue
processing the rest of the options but I am just guessing. Anyhow, just to test I applied this commit to my 3.10.24 kernel:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc33ed5bd9fbaa243bda6fdccb22674aed6305

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

and now it accepts the "-4.2" but I have no idea if this messes up something else.

That should be perfectly safe.

Thanks, I will keep this then until nfs-utils is working.

Quoted 3 lines
Quoted 3 lines

I agree that we should teach the kernel to treat "-4.x" at least as a no-op for unknown .x. But nfs-utils also has to keep working with

older

Quoted 8 lines
Quoted 6 lines

kernels which don't do that.

The problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server support with the -V option". That should be using an array of ints not a bit array, so it can make the distinction between "off", "on", and "don't care".

So, something like this (untested).--b.

I tested this on my system(which has the above kernel patch) and I noticed a difference:
rpc.nfsd: Writing version string to kernel: -2 +3 +4
which is different than previous
rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4

The "+4.1" is missing.

Jocke

#4 lore raw
Quoted 45 lines · Joakim Tjernlund

"J. Bruce Fields" <[email protected]> wrote on 2013/12/16 21:03:01:

Quoted 9 lines

From: "J. Bruce Fields" <[email protected]>
To: Joakim Tjernlund <[email protected]>,
Cc: [email protected], [email protected]
Date: 2013/12/16 21:03
Subject: Re: nfs-utils-1.2.9 does not play well with linux 3.10.x

Quoted 2 lines · bfields
Quoted 1 line · Joakim Tjernlund

rpc.nfsd insists on adding "-4.2" when writing

/proc/fs/nfsd/versions :

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4
Which causes Linux to return an EIVAL error as 3.10 has no support

for 4.2

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

and
does not accept any reference to 4.2

It seems reasonable to me that Linux should accpect -4.2 as a noop

and

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

continue
processing the rest of the options but I am just guessing. Anyhow, just to test I applied this commit to my 3.10.24 kernel:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc33ed5bd9fbaa243bda6fdccb22674aed6305

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

and now it accepts the "-4.2" but I have no idea if this messes up something else.

That should be perfectly safe.

Thanks, I will keep this then until nfs-utils is working.

Quoted 3 lines
Quoted 3 lines

I agree that we should teach the kernel to treat "-4.x" at least as a no-op for unknown .x. But nfs-utils also has to keep working with

older

Quoted 7 lines
Quoted 6 lines

kernels which don't do that.

The problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server support with the -V option". That should be using an array of ints not a bit array, so it can make the distinction between "off", "on", and "don't care".

Quoted 4 lines
Quoted 1 line

So, something like this (untested).--b.

I tested this on my system(which has the above kernel patch) and I noticed a difference:

Thanks!

Quoted 5 lines

rpc.nfsd: Writing version string to kernel: -2 +3 +4
which is different than previous
rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4

The "+4.1" is missing.

Yes, that's intentional. Is it causing you any problem?

--b.

#5 lore raw

"J. Bruce Fields" <[email protected]> wrote on 2013/12/16 21:23:45:

Quoted 6 lines

From: "J. Bruce Fields" <[email protected]>
To: Joakim Tjernlund <[email protected]>,
Cc: [email protected], [email protected]
Date: 2013/12/16 21:23
Subject: Re: nfs-utils-1.2.9 does not play well with linux 3.10.x

Quoted 15 lines
Quoted 14 lines · Joakim Tjernlund

"J. Bruce Fields" <[email protected]> wrote on 2013/12/16 21:03:01:

Quoted 9 lines

From: "J. Bruce Fields" <[email protected]>
To: Joakim Tjernlund <[email protected]>,
Cc: [email protected], [email protected]
Date: 2013/12/16 21:03
Subject: Re: nfs-utils-1.2.9 does not play well with linux 3.10.x

Quoted 2 lines · bfields
Quoted 1 line · Joakim Tjernlund

rpc.nfsd insists on adding "-4.2" when writing

/proc/fs/nfsd/versions :

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4
Which causes Linux to return an EIVAL error as 3.10 has no

support

Quoted 5 lines
Quoted 5 lines

for 4.2

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

and
does not accept any reference to 4.2

It seems reasonable to me that Linux should accpect -4.2 as a

noop

Quoted 7 lines
Quoted 7 lines

and

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

continue
processing the rest of the options but I am just guessing. Anyhow, just to test I applied this commit to my 3.10.24 kernel:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc33ed5bd9fbaa243bda6fdccb22674aed6305

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

and now it accepts the "-4.2" but I have no idea if this messes

up

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

something else.

That should be perfectly safe.

Thanks, I will keep this then until nfs-utils is working.

Quoted 2 lines
Quoted 2 lines

I agree that we should teach the kernel to treat "-4.x" at least

as a

Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line

no-op for unknown .x. But nfs-utils also has to keep working with

older

Quoted 3 lines
Quoted 3 lines

kernels which don't do that.

The problem was introduced by

12a590f8d556c00a9502eeebaa763d906222d521

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"rpc.nfsd: Allow v4.2 server support with the -V option". That

should

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

be using an array of ints not a bit array, so it can make the distinction between "off", "on", and "don't care".

So, something like this (untested).--b.

I tested this on my system(which has the above kernel patch) and I

noticed

Quoted 11 lines
Quoted 1 line

a difference:

Thanks!

Quoted 5 lines

rpc.nfsd: Writing version string to kernel: -2 +3 +4
which is different than previous
rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4

The "+4.1" is missing.

Yes, that's intentional. Is it causing you any problem?

I don't know yet, but I don't think it would be a problem for me. However, are you not changing the defaults here? In that case someone else relying on 4.1 might have a problem I guess.

Jocke

#6 lore raw
Quoted 75 lines · Joakim Tjernlund

"J. Bruce Fields" <[email protected]> wrote on 2013/12/16 21:23:45:

Quoted 6 lines

From: "J. Bruce Fields" <[email protected]>
To: Joakim Tjernlund <[email protected]>,
Cc: [email protected], [email protected]
Date: 2013/12/16 21:23
Subject: Re: nfs-utils-1.2.9 does not play well with linux 3.10.x

Quoted 15 lines
Quoted 14 lines · Joakim Tjernlund

"J. Bruce Fields" <[email protected]> wrote on 2013/12/16 21:03:01:

Quoted 9 lines

From: "J. Bruce Fields" <[email protected]>
To: Joakim Tjernlund <[email protected]>,
Cc: [email protected], [email protected]
Date: 2013/12/16 21:03
Subject: Re: nfs-utils-1.2.9 does not play well with linux 3.10.x

Quoted 2 lines · bfields
Quoted 1 line · Joakim Tjernlund

rpc.nfsd insists on adding "-4.2" when writing

/proc/fs/nfsd/versions :

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4
Which causes Linux to return an EIVAL error as 3.10 has no

support

Quoted 5 lines
Quoted 5 lines

for 4.2

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

and
does not accept any reference to 4.2

It seems reasonable to me that Linux should accpect -4.2 as a

noop

Quoted 7 lines
Quoted 7 lines

and

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

continue
processing the rest of the options but I am just guessing. Anyhow, just to test I applied this commit to my 3.10.24 kernel:

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc33ed5bd9fbaa243bda6fdccb22674aed6305

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

and now it accepts the "-4.2" but I have no idea if this messes

up

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

something else.

That should be perfectly safe.

Thanks, I will keep this then until nfs-utils is working.

Quoted 2 lines
Quoted 2 lines

I agree that we should teach the kernel to treat "-4.x" at least

as a

Quoted 6 lines
Quoted 6 lines
Quoted 1 line
Quoted 1 line

no-op for unknown .x. But nfs-utils also has to keep working with

older

Quoted 3 lines
Quoted 3 lines

kernels which don't do that.

The problem was introduced by

12a590f8d556c00a9502eeebaa763d906222d521

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"rpc.nfsd: Allow v4.2 server support with the -V option". That

should

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

be using an array of ints not a bit array, so it can make the distinction between "off", "on", and "don't care".

So, something like this (untested).--b.

I tested this on my system(which has the above kernel patch) and I

noticed

Quoted 8 lines
Quoted 1 line

a difference:

Thanks!

Quoted 4 lines

rpc.nfsd: Writing version string to kernel: -2 +3 +4
which is different than previous
rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

The "+4.1" is missing.

Yes, that's intentional. Is it causing you any problem?

I don't know yet, but I don't think it would be a problem for me. However, are you not changing the defaults here? In that case someone else relying on 4.1 might have a problem I guess.

That's just restoring the behavior we had before 12a590f8d556c00a9502eeebaa763d906222d521, and will still result in 4.1 being turned on if the kernel is recent enough.

--b.

#7 lore raw

"J. Bruce Fields" <[email protected]> wrote on 2013/12/17 04:38:49:

Quoted 12 lines · Joakim Tjernlund
Quoted 10 lines

"J. Bruce Fields" <[email protected]> wrote on 2013/12/16 21:23:45:

Quoted 8 lines

From: "J. Bruce Fields" <[email protected]>
To: Joakim Tjernlund <[email protected]>,
Cc: [email protected], [email protected]
Date: 2013/12/16 21:23
Subject: Re: nfs-utils-1.2.9 does not play well with linux 3.10.x

Quoted 1 line · Joakim Tjernlund

"J. Bruce Fields" <[email protected]> wrote on 2013/12/16

21:03:01:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

From: "J. Bruce Fields" <[email protected]>
To: Joakim Tjernlund <[email protected]>,
Cc: [email protected], [email protected]
Date: 2013/12/16 21:03
Subject: Re: nfs-utils-1.2.9 does not play well with linux

3.10.x

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · bfields
Quoted 1 line

On Mon, Dec 16, 2013 at 07:16:00PM +0100, Joakim Tjernlund

Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

rpc.nfsd insists on adding "-4.2" when writing

/proc/fs/nfsd/versions :

Quoted 1 line
Quoted 1 line
Quoted 1 line

rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2

+3 +4

Quoted 7 lines
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Which causes Linux to return an EIVAL error as 3.10 has no

support

Quoted 5 lines
Quoted 5 lines

for 4.2

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

and
does not accept any reference to 4.2

It seems reasonable to me that Linux should accpect -4.2 as

a

Quoted 5 lines
Quoted 5 lines

noop

Quoted 4 lines
Quoted 4 lines

and

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

continue
processing the rest of the options but I am just guessing. Anyhow, just to test I applied this commit to my 3.10.24

kernel:

Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4bdc33ed5bd9fbaa243bda6fdccb22674aed6305

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

and now it accepts the "-4.2" but I have no idea if this

messes

Quoted 9 lines
Quoted 9 lines

up

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

something else.

That should be perfectly safe.

Thanks, I will keep this then until nfs-utils is working.

Quoted 2 lines
Quoted 2 lines

I agree that we should teach the kernel to treat "-4.x" at

least

Quoted 2 lines
Quoted 2 lines

as a

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

no-op for unknown .x. But nfs-utils also has to keep working

with

Quoted 29 lines
Quoted 29 lines
Quoted 5 lines
Quoted 5 lines

older

Quoted 3 lines
Quoted 3 lines

kernels which don't do that.

The problem was introduced by

12a590f8d556c00a9502eeebaa763d906222d521

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"rpc.nfsd: Allow v4.2 server support with the -V option". That

should

Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

be using an array of ints not a bit array, so it can make the distinction between "off", "on", and "don't care".

So, something like this (untested).--b.

I tested this on my system(which has the above kernel patch) and I

noticed

Quoted 11 lines
Quoted 1 line

a difference:

Thanks!

Quoted 5 lines

rpc.nfsd: Writing version string to kernel: -2 +3 +4
which is different than previous
rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4

The "+4.1" is missing.

Yes, that's intentional. Is it causing you any problem?

Quoted 7 lines
Quoted 3 lines

I don't know yet, but I don't think it would be a problem for me. However, are you not changing the defaults here? In that case someone else relying on 4.1 might have a problem I guess.

That's just restoring the behavior we had before 12a590f8d556c00a9502eeebaa763d906222d521, and will still result in 4.1 being turned on if the kernel is recent enough.

What is an recent enough kernel? Does not 3.10.24 patched with the patch I mentioned
earlier? I thought it would make 3.10 look like a 3.11 which have 4.2 supported.
If I am mistaken we good I guess.

Jocke

#8 lore raw
Quoted 35 lines · Joakim Tjernlund

"J. Bruce Fields" <[email protected]> wrote on 2013/12/17 04:38:49:

Quoted 26 lines · Joakim Tjernlund
Quoted 24 lines

"J. Bruce Fields" <[email protected]> wrote on 2013/12/16 21:23:45:

Quoted 8 lines

From: "J. Bruce Fields" <[email protected]>
To: Joakim Tjernlund <[email protected]>,
Cc: [email protected], [email protected]
Date: 2013/12/16 21:23
Subject: Re: nfs-utils-1.2.9 does not play well with linux 3.10.x

Quoted 1 line · Joakim Tjernlund

I tested this on my system(which has the above kernel patch) and I

noticed

Quoted 11 lines
Quoted 1 line

a difference:

Thanks!

Quoted 5 lines

rpc.nfsd: Writing version string to kernel: -2 +3 +4
which is different than previous
rpc.nfsd: Writing version string to kernel: +4.1 -4.2 -2 +3 +4

The "+4.1" is missing.

Yes, that's intentional. Is it causing you any problem?

Quoted 7 lines
Quoted 3 lines

I don't know yet, but I don't think it would be a problem for me. However, are you not changing the defaults here? In that case someone else relying on 4.1 might have a problem I guess.

That's just restoring the behavior we had before 12a590f8d556c00a9502eeebaa763d906222d521, and will still result in 4.1 being turned on if the kernel is recent enough.

Quoted 5 lines

What is an recent enough kernel? Does not 3.10.24 patched with the patch I mentioned
earlier? I thought it would make 3.10 look like a 3.11 which have 4.2 supported.
If I am mistaken we good I guess.

Sorry, I don't understand exactly what your concern is.

--b.

#9 lore raw

PATCH 1/1 nfsd: fix minorversion-choosing interface

In reply to Joakim Tjernlund

From: "J. Bruce Fields" <[email protected]>

By unconditionally adding +/-4.2 to the version string written to the kernel we make nfs-utils incompatible with pre-4.2-supporting kernels.

Ditto for 4.1. This problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server support with the -V option", which also change nfsd to unconditionally pass +/-4.2.

Instead, just don't mention 4.1 or 4.2 unless the commandline has specifically requested that one or the other be turned on or off.

---
 support/include/nfs/nfs.h | 1 -
 utils/nfsd/nfsd.c         | 6 +++---
 utils/nfsd/nfssvc.c       | 6 +++---
 utils/nfsd/nfssvc.h       | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)
support/include/nfs/nfs.h +0 -1
index 38db5b5..df4ad76 100644
@@ -17,7 +17,6 @@
 
 #define NFS4_MINMINOR 1
 #define NFS4_MAXMINOR 2
-#define NFS4_VERDEFAULT  0x1  /* minor verion 1 */
 
 struct nfs_fh_len {
 	int		fh_size;
utils/nfsd/nfsd.c +3 -3
index 6db92f0..a9d77ab 100644
@@ -99,7 +99,7 @@ main(int argc, char **argv)
 	char *p, *progname, *port;
 	char *haddr = NULL;
 	int	socket_up = 0;
-	int minorvers = NFS4_VERDEFAULT;	/* nfsv4 minor version */
+	int minorvers[NFS4_MAXMINOR + 1] = {0};
 	unsigned int versbits = NFSCTL_VERDEFAULT;
 	unsigned int protobits = NFSCTL_ALLBITS;
 	unsigned int proto4 = 0;
@@ -164,7 +164,7 @@ main(int argc, char **argv)
 						fprintf(stderr, "%s: unsupported minor version\n", optarg);
 						exit(1);
 					}
-					NFSCTL_VERUNSET(minorvers, i);
+					minorvers[i] = -1;
 					break;
 				}
 			case 3:
@@ -185,7 +185,7 @@ main(int argc, char **argv)
 						fprintf(stderr, "%s: unsupported minor version\n", optarg);
 						exit(1);
 					}
-					NFSCTL_VERSET(minorvers, i);
+					minorvers[i] = 1;
 					break;
 				}
 			case 3:
utils/nfsd/nfssvc.c +3 -3
index 8b85846..1b50aba 100644
@@ -269,7 +269,7 @@ nfssvc_set_sockets(const int family, const unsigned int protobits,
 }
 
 void
-nfssvc_setvers(unsigned int ctlbits, int minorvers)
+nfssvc_setvers(unsigned int ctlbits, int minorvers[])
 {
 	int fd, n, off;
 	char *ptr;
@@ -281,9 +281,9 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers)
 		return;
 
 	for (n = NFS4_MINMINOR; n <= NFS4_MAXMINOR; n++) {
-		if (NFSCTL_VERISSET(minorvers, n)) 
+		if (minorvers[n] == 1)
 			off += snprintf(ptr+off, sizeof(buf) - off, "+4.%d ", n);
-		else			
+		else if (minorvers[n] == -1)
 			off += snprintf(ptr+off, sizeof(buf) - off, "-4.%d ", n);
 	}
 	for (n = NFSD_MINVERS; n <= NFSD_MAXVERS; n++) {
utils/nfsd/nfssvc.h +1 -1
index 08de0fe..2bbd3d3 100644
@@ -24,5 +24,5 @@ void	nfssvc_mount_nfsdfs(char *progname);
 int	nfssvc_inuse(void);
 int	nfssvc_set_sockets(const int family, const unsigned int protobits,
 			   const char *host, const char *port);
-void	nfssvc_setvers(unsigned int ctlbits, int minorvers4);
+void	nfssvc_setvers(unsigned int ctlbits, int minorvers4[]);
 int	nfssvc_threads(unsigned short port, int nrservs);
Signature · 1 line
1.8.3.1
#10 lore raw

Re: [PATCH] nfsd: fix minorversion-choosing interface

Quoted 10 lines · J. Bruce Fields

From: "J. Bruce Fields" <[email protected]>

By unconditionally adding +/-4.2 to the version string written to the kernel we make nfs-utils incompatible with pre-4.2-supporting kernels.

Ditto for 4.1. This problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server support with the -V option", which also change nfsd to unconditionally pass +/-4.2.

Quoted 6 lines

Instead, just don't mention 4.1 or 4.2 unless the commandline has specifically requested that one or the other be turned on or off.

Committed...

steved

Quoted 87 lines
---
 support/include/nfs/nfs.h | 1 -
 utils/nfsd/nfsd.c         | 6 +++---
 utils/nfsd/nfssvc.c       | 6 +++---
 utils/nfsd/nfssvc.h       | 2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)
support/include/nfs/nfs.h +0 -1
index 38db5b5..df4ad76 100644
@@ -17,7 +17,6 @@
 
 #define NFS4_MINMINOR 1
 #define NFS4_MAXMINOR 2
-#define NFS4_VERDEFAULT  0x1  /* minor verion 1 */
 
 struct nfs_fh_len {
 	int		fh_size;
utils/nfsd/nfsd.c +3 -3
index 6db92f0..a9d77ab 100644
@@ -99,7 +99,7 @@ main(int argc, char **argv)
 	char *p, *progname, *port;
 	char *haddr = NULL;
 	int	socket_up = 0;
-	int minorvers = NFS4_VERDEFAULT;	/* nfsv4 minor version */
+	int minorvers[NFS4_MAXMINOR + 1] = {0};
 	unsigned int versbits = NFSCTL_VERDEFAULT;
 	unsigned int protobits = NFSCTL_ALLBITS;
 	unsigned int proto4 = 0;
@@ -164,7 +164,7 @@ main(int argc, char **argv)
 						fprintf(stderr, "%s: unsupported minor version\n", optarg);
 						exit(1);
 					}
-					NFSCTL_VERUNSET(minorvers, i);
+					minorvers[i] = -1;
 					break;
 				}
 			case 3:
@@ -185,7 +185,7 @@ main(int argc, char **argv)
 						fprintf(stderr, "%s: unsupported minor version\n", optarg);
 						exit(1);
 					}
-					NFSCTL_VERSET(minorvers, i);
+					minorvers[i] = 1;
 					break;
 				}
 			case 3:
utils/nfsd/nfssvc.c +3 -3
index 8b85846..1b50aba 100644
@@ -269,7 +269,7 @@ nfssvc_set_sockets(const int family, const unsigned int protobits,
 }
 
 void
-nfssvc_setvers(unsigned int ctlbits, int minorvers)
+nfssvc_setvers(unsigned int ctlbits, int minorvers[])
 {
 	int fd, n, off;
 	char *ptr;
@@ -281,9 +281,9 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers)
 		return;
 
 	for (n = NFS4_MINMINOR; n <= NFS4_MAXMINOR; n++) {
-		if (NFSCTL_VERISSET(minorvers, n)) 
+		if (minorvers[n] == 1)
 			off += snprintf(ptr+off, sizeof(buf) - off, "+4.%d ", n);
-		else			
+		else if (minorvers[n] == -1)
 			off += snprintf(ptr+off, sizeof(buf) - off, "-4.%d ", n);
 	}
 	for (n = NFSD_MINVERS; n <= NFSD_MAXVERS; n++) {
utils/nfsd/nfssvc.h +1 -1
index 08de0fe..2bbd3d3 100644
@@ -24,5 +24,5 @@ void	nfssvc_mount_nfsdfs(char *progname);
 int	nfssvc_inuse(void);
 int	nfssvc_set_sockets(const int family, const unsigned int protobits,
 			   const char *host, const char *port);
-void	nfssvc_setvers(unsigned int ctlbits, int minorvers4);
+void	nfssvc_setvers(unsigned int ctlbits, int minorvers4[]);
 int	nfssvc_threads(unsigned short port, int nrservs);
#11 lore raw

Re: [PATCH] nfsd: fix minorversion-choosing interface

Steve Dickson <[email protected]> wrote on 2014/01/07 22:02:01:

Quoted 16 lines · J. Bruce Fields
Quoted 13 lines

From: "J. Bruce Fields" <[email protected]>

By unconditionally adding +/-4.2 to the version string written to the kernel we make nfs-utils incompatible with pre-4.2-supporting kernels.

Ditto for 4.1. This problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server support with the -V option", which also change nfsd to unconditionally pass +/-4.2.

Instead, just don't mention 4.1 or 4.2 unless the commandline has specifically requested that one or the other be turned on or off.

Quoted 6 lines
Quoted 3 lines

Committed...

steved

Thanks, do plan on making a release soon?

Jocke

#12 lore raw

Re: [PATCH] nfsd: fix minorversion-choosing interface

Quoted 17 lines · Joakim Tjernlund

Steve Dickson <[email protected]> wrote on 2014/01/07 22:02:01:

Quoted 16 lines · J. Bruce Fields
Quoted 13 lines

From: "J. Bruce Fields" <[email protected]>

By unconditionally adding +/-4.2 to the version string written to the kernel we make nfs-utils incompatible with pre-4.2-supporting kernels.

Ditto for 4.1. This problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2 server support with the -V option", which also change nfsd to unconditionally pass +/-4.2.

Instead, just don't mention 4.1 or 4.2 unless the commandline has specifically requested that one or the other be turned on or off.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Committed...

steved

Thanks, do plan on making a release soon?

Sorry for the delayed response...

Its in my git tree and in Fedora 20 nfs-utils....

Is this what you were looking for?

steved.

Quoted 3 lines

Jocke

#13 lore raw

Re: [PATCH] nfsd: fix minorversion-choosing interface

Steve Dickson <[email protected]> wrote on 2014/01/09 17:06:41:

Quoted 10 lines · Joakim Tjernlund
Quoted 7 lines

Steve Dickson <[email protected]> wrote on 2014/01/07 22:02:01:

Quoted 6 lines · J. Bruce Fields
Quoted 3 lines

From: "J. Bruce Fields" <[email protected]>

By unconditionally adding +/-4.2 to the version string written to

the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

kernel we make nfs-utils incompatible with pre-4.2-supporting

kernels.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Ditto for 4.1. This problem was introduced by 12a590f8d556c00a9502eeebaa763d906222d521 "rpc.nfsd: Allow v4.2

server

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

support with the -V option", which also change nfsd to

unconditionally

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines
Quoted 8 lines

pass +/-4.2.

Instead, just don't mention 4.1 or 4.2 unless the commandline has specifically requested that one or the other be turned on or off.

Committed...

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

steved

Thanks, do plan on making a release soon?

Sorry for the delayed response...

Its in my git tree and in Fedora 20 nfs-utils....

Is this what you were looking for?

No, I am wondering when nfs-utils 1.2.10 will be released, but I see now that
the tree is tagged with 1-2-10-rc2 so I guess it will be soon.

Jocke