2007-01-05 02:42:14

by Wu Fengguang

[permalink] [raw]
Subject: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

Hi Neil,

NFS mounting succeeded, but the kernel gives a warning.
I'm running 2.6.20-rc2-mm1.

# mount -o vers=3 localhost:/suse /mnt
[ 689.651606] svc: unknown version (3)
# mount | grep suse
localhost:/suse on /mnt type nfs (rw,nfsvers=3,addr=127.0.0.1)

Any clues about it?

Short .config:

#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.20-rc2-mm1
# Thu Jan 4 15:55:02 2007
#
CONFIG_X86_64=y
CONFIG_64BIT=y
CONFIG_X86=y

......

#
# Network File Systems
#
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
# CONFIG_NFS_V4 is not set
CONFIG_NFS_DIRECTIO=y
CONFIG_NFSD=m
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y
CONFIG_NFSD_TCP=y
CONFIG_LOCKD=m
CONFIG_LOCKD_V4=y
CONFIG_EXPORTFS=m
CONFIG_NFS_ACL_SUPPORT=m
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=m
CONFIG_SUNRPC_GSS=m
CONFIG_RPCSEC_GSS_KRB5=m
CONFIG_RPCSEC_GSS_SPKM3=m
CONFIG_SMB_FS=m
# CONFIG_SMB_NLS_DEFAULT is not set
CONFIG_CIFS=m
CONFIG_CIFS_STATS=y
# CONFIG_CIFS_STATS2 is not set
# CONFIG_CIFS_WEAK_PW_HASH is not set
CONFIG_CIFS_XATTR=y
CONFIG_CIFS_POSIX=y
# CONFIG_CIFS_DEBUG2 is not set
# CONFIG_CIFS_EXPERIMENTAL is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_9P_FS=m

......

Thanks,
Wu


2007-01-05 12:25:51

by Trond Myklebust

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Fri, 2007-01-05 at 10:42 +0800, Fengguang Wu wrote:
> Hi Neil,
>
> NFS mounting succeeded, but the kernel gives a warning.
> I'm running 2.6.20-rc2-mm1.
>
> # mount -o vers=3 localhost:/suse /mnt
> [ 689.651606] svc: unknown version (3)
> # mount | grep suse
> localhost:/suse on /mnt type nfs (rw,nfsvers=3,addr=127.0.0.1)

Are you perhaps running the userland NFS server instead of knfsd? The
former will only support NFSv2.

Trond

2007-01-05 12:48:32

by Wu Fengguang

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Fri, Jan 05, 2007 at 01:25:39PM +0100, Trond Myklebust wrote:
> On Fri, 2007-01-05 at 10:42 +0800, Fengguang Wu wrote:
> > Hi Neil,
> >
> > NFS mounting succeeded, but the kernel gives a warning.
> > I'm running 2.6.20-rc2-mm1.
> >
> > # mount -o vers=3 localhost:/suse /mnt
> > [ 689.651606] svc: unknown version (3)
> > # mount | grep suse
> > localhost:/suse on /mnt type nfs (rw,nfsvers=3,addr=127.0.0.1)
>
> Are you perhaps running the userland NFS server instead of knfsd? The
> former will only support NFSv2.

I'm running kernel nfs servers:

USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 5451 0.0 0.0 0 0 ? S 19:30 0:00 [nfsd]
root 5452 0.0 0.0 0 0 ? S 19:30 0:00 [nfsd]
root 5453 0.0 0.0 0 0 ? S 19:30 0:00 [nfsd]
root 5454 0.0 0.0 0 0 ? S 19:30 0:00 [nfsd]
root 5455 0.0 0.0 0 0 ? S 19:30 0:00 [nfsd]
root 5456 0.0 0.0 0 0 ? S 19:30 0:00 [nfsd]
root 5457 0.0 0.0 0 0 ? S 19:30 0:00 [nfsd]
root 5458 0.0 0.0 0 0 ? S 19:30 0:00 [nfsd]
root 5449 0.0 0.0 0 0 ? S< 19:30 0:00 [rpciod/0]
root 5450 0.0 0.0 0 0 ? S< 19:30 0:00 [rpciod/1]
root 5462 0.0 0.0 7940 672 ? Ss 19:30 0:00 /usr/sbin/rpc.mountd
statd 5527 0.0 0.0 7892 1084 ? Ss 19:30 0:00 /sbin/rpc.statd
root 5538 0.0 0.0 23168 764 ? Ss 19:30 0:00 /usr/sbin/rpc.idmapd

My system is Debian etch. And I just found that CONFIG_NFSD_V4 is irrelevant,
the message remains even if it is disabled. I'll check more kernel versions.

Thanks,
Wu

2007-01-10 06:01:45

by NeilBrown

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Friday January 5, [email protected] wrote:
> Hi Neil,
>
> NFS mounting succeeded, but the kernel gives a warning.
> I'm running 2.6.20-rc2-mm1.
>
> # mount -o vers=3 localhost:/suse /mnt
> [ 689.651606] svc: unknown version (3)
> # mount | grep suse
> localhost:/suse on /mnt type nfs (rw,nfsvers=3,addr=127.0.0.1)
>
> Any clues about it?

Weird.

Please try this patch. It should provide more useful information.

NeilBrown

Signed-off-by: Neil Brown <[email protected]>

### Diffstat output
./net/sunrpc/svc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff .prev/net/sunrpc/svc.c ./net/sunrpc/svc.c
--- .prev/net/sunrpc/svc.c 2007-01-10 16:58:14.000000000 +1100
+++ ./net/sunrpc/svc.c 2007-01-10 16:59:55.000000000 +1100
@@ -910,7 +910,8 @@ err_bad_prog:

err_bad_vers:
#ifdef RPC_PARANOIA
- printk("svc: unknown version (%d)\n", vers);
+ printk("svc: unknown version (%d for prog %d, %s)\n",
+ vers, prog, progp->pg_name);
#endif
serv->sv_stats->rpcbadfmt++;
svc_putnl(resv, RPC_PROG_MISMATCH);

2007-01-10 14:17:40

by Wu Fengguang

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Wed, Jan 10, 2007 at 05:01:23PM +1100, Neil Brown wrote:
> On Friday January 5, [email protected] wrote:
> > Hi Neil,
> >
> > NFS mounting succeeded, but the kernel gives a warning.
> > I'm running 2.6.20-rc2-mm1.
> >
> > # mount -o vers=3 localhost:/suse /mnt
> > [ 689.651606] svc: unknown version (3)
> > # mount | grep suse
> > localhost:/suse on /mnt type nfs (rw,nfsvers=3,addr=127.0.0.1)
> >
> > Any clues about it?
>
> Weird.
>
> Please try this patch. It should provide more useful information.
>
> NeilBrown
>
> Signed-off-by: Neil Brown <[email protected]>
>
> ### Diffstat output
> ./net/sunrpc/svc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff .prev/net/sunrpc/svc.c ./net/sunrpc/svc.c
> --- .prev/net/sunrpc/svc.c 2007-01-10 16:58:14.000000000 +1100
> +++ ./net/sunrpc/svc.c 2007-01-10 16:59:55.000000000 +1100
> @@ -910,7 +910,8 @@ err_bad_prog:
>
> err_bad_vers:
> #ifdef RPC_PARANOIA
> - printk("svc: unknown version (%d)\n", vers);
> + printk("svc: unknown version (%d for prog %d, %s)\n",
> + vers, prog, progp->pg_name);
> #endif
> serv->sv_stats->rpcbadfmt++;
> svc_putnl(resv, RPC_PROG_MISMATCH);

root ~# mount localhost:/suse /mnt
[ 132.678204] svc: unknown version (3 for prog 100227, nfsd)

I've confirmed that 2.6.20-rc2-mm1, 2.6.20-rc3-mm1, 2.6.19-rc6-mm1 all
have this warning, while 2.6.17-2-amd64 is good.

Thanks,
Wu

2007-01-10 15:20:11

by Arnaud Giersch

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

Fengguang Wu <fengguang.wu <at> gmail.com> writes:

> root ~# mount localhost:/suse /mnt
> [ 132.678204] svc: unknown version (3 for prog 100227, nfsd)
>
> I've confirmed that 2.6.20-rc2-mm1, 2.6.20-rc3-mm1, 2.6.19-rc6-mm1 all
> have this warning, while 2.6.17-2-amd64 is good.

I get the same log messages here with 2.6.19. I also noticed the following
messages when starting rpc.nfsd:

nfsd[1287]: nfssvc: writting fds to kernel failed: errno 0 (Success)
nfsd[1287]: nfssvc: writting fds to kernel failed: errno 0 (Success)

These messages appeared with kernel 2.6.19 too. I however don't know if
this could be related to the other messages.
I use nfs-utils 1.0.10 on Debian Etch.

Arnaud Giersch


2007-01-11 03:59:32

by NeilBrown

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Wednesday January 10, [email protected] wrote:
>
> root ~# mount localhost:/suse /mnt
> [ 132.678204] svc: unknown version (3 for prog 100227, nfsd)
>
> I've confirmed that 2.6.20-rc2-mm1, 2.6.20-rc3-mm1, 2.6.19-rc6-mm1 all
> have this warning, while 2.6.17-2-amd64 is good.

Thanks. That helps a lot.

This patch should help too. Please let me know.

NeilBrown


Signed-off-by: Neil Brown <[email protected]>

### Diffstat output
./fs/nfsd/nfssvc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff .prev/fs/nfsd/nfssvc.c ./fs/nfsd/nfssvc.c
--- .prev/fs/nfsd/nfssvc.c 2007-01-11 14:55:38.000000000 +1100
+++ ./fs/nfsd/nfssvc.c 2007-01-11 14:57:03.000000000 +1100
@@ -72,7 +72,7 @@ static struct svc_program nfsd_acl_progr
.pg_prog = NFS_ACL_PROGRAM,
.pg_nvers = NFSD_ACL_NRVERS,
.pg_vers = nfsd_acl_versions,
- .pg_name = "nfsd",
+ .pg_name = "nfsacl",
.pg_class = "nfsd",
.pg_stats = &nfsd_acl_svcstats,
.pg_authenticate = &svc_set_client,
@@ -121,13 +121,13 @@ int nfsd_vers(int vers, enum vers_op cha
break;
#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
if (vers < NFSD_ACL_NRVERS)
- nfsd_acl_version[vers] = nfsd_acl_version[vers];
+ nfsd_acl_versions[vers] = nfsd_acl_version[vers];
#endif
case NFSD_CLEAR:
nfsd_versions[vers] = NULL;
#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
if (vers < NFSD_ACL_NRVERS)
- nfsd_acl_version[vers] = NULL;
+ nfsd_acl_versions[vers] = NULL;
#endif
break;
case NFSD_TEST:

2007-01-11 14:53:42

by Wu Fengguang

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

Neil,

On Thu, Jan 11, 2007 at 02:59:07PM +1100, Neil Brown wrote:
> On Wednesday January 10, [email protected] wrote:
> >
> > root ~# mount localhost:/suse /mnt
> > [ 132.678204] svc: unknown version (3 for prog 100227, nfsd)
> >
> > I've confirmed that 2.6.20-rc2-mm1, 2.6.20-rc3-mm1, 2.6.19-rc6-mm1 all
> > have this warning, while 2.6.17-2-amd64 is good.
>
> Thanks. That helps a lot.
>
> This patch should help too. Please let me know.

# mount localhost:/suse /mnt
[ 2058.438236] svc: unknown version (3 for prog 100227, nfsd)

# pss nfs
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 5488 0.0 0.0 0 0 ? S 22:16 0:00 [nfsd]
root 5489 0.0 0.0 0 0 ? S 22:16 0:00 [nfsd]
root 5490 0.0 0.0 0 0 ? S 22:16 0:00 [nfsd]
root 5491 0.0 0.0 0 0 ? S 22:16 0:00 [nfsd]
root 5492 0.0 0.0 0 0 ? S 22:16 0:00 [nfsd]
root 5493 0.0 0.0 0 0 ? S 22:16 0:00 [nfsd]
root 5494 0.0 0.0 0 0 ? S 22:16 0:00 [nfsd]
root 5495 0.0 0.0 0 0 ? S 22:16 0:00 [nfsd]
# pss rpc
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 5486 0.0 0.0 0 0 ? S< 22:16 0:00 [rpciod/0]
root 5487 0.0 0.0 0 0 ? S< 22:16 0:00 [rpciod/1]
root 5499 0.0 0.0 7944 668 ? Ss 22:16 0:00 /usr/sbin/rpc.mountd
statd 5567 0.0 0.0 7892 1084 ? Ss 22:16 0:00 /sbin/rpc.statd
root 5578 0.0 0.0 23180 652 ? Ss 22:16 0:00 /usr/sbin/rpc.idmapd

Thanks,
Wu

>
> Signed-off-by: Neil Brown <[email protected]>
>
> ### Diffstat output
> ./fs/nfsd/nfssvc.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff .prev/fs/nfsd/nfssvc.c ./fs/nfsd/nfssvc.c
> --- .prev/fs/nfsd/nfssvc.c 2007-01-11 14:55:38.000000000 +1100
> +++ ./fs/nfsd/nfssvc.c 2007-01-11 14:57:03.000000000 +1100
> @@ -72,7 +72,7 @@ static struct svc_program nfsd_acl_progr
> .pg_prog = NFS_ACL_PROGRAM,
> .pg_nvers = NFSD_ACL_NRVERS,
> .pg_vers = nfsd_acl_versions,
> - .pg_name = "nfsd",
> + .pg_name = "nfsacl",
> .pg_class = "nfsd",
> .pg_stats = &nfsd_acl_svcstats,
> .pg_authenticate = &svc_set_client,
> @@ -121,13 +121,13 @@ int nfsd_vers(int vers, enum vers_op cha
> break;
> #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
> if (vers < NFSD_ACL_NRVERS)
> - nfsd_acl_version[vers] = nfsd_acl_version[vers];
> + nfsd_acl_versions[vers] = nfsd_acl_version[vers];
> #endif
> case NFSD_CLEAR:
> nfsd_versions[vers] = NULL;
> #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
> if (vers < NFSD_ACL_NRVERS)
> - nfsd_acl_version[vers] = NULL;
> + nfsd_acl_versions[vers] = NULL;
> #endif
> break;
> case NFSD_TEST:

2007-01-11 22:04:39

by NeilBrown

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Thursday January 11, [email protected] wrote:
> Neil,
>
> On Thu, Jan 11, 2007 at 02:59:07PM +1100, Neil Brown wrote:
> > On Wednesday January 10, [email protected] wrote:
> > >
> > > root ~# mount localhost:/suse /mnt
> > > [ 132.678204] svc: unknown version (3 for prog 100227, nfsd)
> > >
> > > I've confirmed that 2.6.20-rc2-mm1, 2.6.20-rc3-mm1, 2.6.19-rc6-mm1 all
> > > have this warning, while 2.6.17-2-amd64 is good.
> >
> > Thanks. That helps a lot.
> >
> > This patch should help too. Please let me know.
>
> # mount localhost:/suse /mnt
> [ 2058.438236] svc: unknown version (3 for prog 100227, nfsd)

Are you really really double-plus sure that you are running a kernel
with the patch applied?
Because at the very least it should have changed the message to

> [ 2058.438236] svc: unknown version (3 for prog 100227, nfsacl)

NeilBrown

2007-01-12 02:32:28

by Wu Fengguang

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Fri, Jan 12, 2007 at 09:04:15AM +1100, Neil Brown wrote:
> On Thursday January 11, [email protected] wrote:
> > Neil,
> >
> > On Thu, Jan 11, 2007 at 02:59:07PM +1100, Neil Brown wrote:
> > > On Wednesday January 10, [email protected] wrote:
> > > >
> > > > root ~# mount localhost:/suse /mnt
> > > > [ 132.678204] svc: unknown version (3 for prog 100227, nfsd)
> > > >
> > > > I've confirmed that 2.6.20-rc2-mm1, 2.6.20-rc3-mm1, 2.6.19-rc6-mm1 all
> > > > have this warning, while 2.6.17-2-amd64 is good.
> > >
> > > Thanks. That helps a lot.
> > >
> > > This patch should help too. Please let me know.
> >
> > # mount localhost:/suse /mnt
> > [ 2058.438236] svc: unknown version (3 for prog 100227, nfsd)
>
> Are you really really double-plus sure that you are running a kernel
> with the patch applied?
> Because at the very least it should have changed the message to

Oh, sorry. I recompiled & installed kernel and it output this new message:

[ 133.129919] svc: unknown version (3 for prog 100227, nfsacl)

Regards,
Wu

2007-01-12 19:43:33

by NeilBrown

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Friday January 12, [email protected] wrote:
> > Are you really really double-plus sure that you are running a kernel
> > with the patch applied?
> > Because at the very least it should have changed the message to
>
> Oh, sorry. I recompiled & installed kernel and it output this new message:
>
> [ 133.129919] svc: unknown version (3 for prog 100227, nfsacl)
>

Ok, thanks. I must have missed something else wrong in the code......

Probably this 'break' in the wrong place...

Could you try this patch instead please - or just move the 'break' to
where it should be.

Thanks,
NeilBrown

Signed-off-by: Neil Brown <[email protected]>

### Diffstat output
./fs/nfsd/nfssvc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff .prev/fs/nfsd/nfssvc.c ./fs/nfsd/nfssvc.c
--- .prev/fs/nfsd/nfssvc.c 2007-01-11 14:55:38.000000000 +1100
+++ ./fs/nfsd/nfssvc.c 2007-01-13 06:40:12.000000000 +1100
@@ -72,7 +72,7 @@ static struct svc_program nfsd_acl_progr
.pg_prog = NFS_ACL_PROGRAM,
.pg_nvers = NFSD_ACL_NRVERS,
.pg_vers = nfsd_acl_versions,
- .pg_name = "nfsd",
+ .pg_name = "nfsacl",
.pg_class = "nfsd",
.pg_stats = &nfsd_acl_svcstats,
.pg_authenticate = &svc_set_client,
@@ -118,16 +118,16 @@ int nfsd_vers(int vers, enum vers_op cha
switch(change) {
case NFSD_SET:
nfsd_versions[vers] = nfsd_version[vers];
- break;
#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
if (vers < NFSD_ACL_NRVERS)
- nfsd_acl_version[vers] = nfsd_acl_version[vers];
+ nfsd_acl_versions[vers] = nfsd_acl_version[vers];
#endif
+ break;
case NFSD_CLEAR:
nfsd_versions[vers] = NULL;
#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
if (vers < NFSD_ACL_NRVERS)
- nfsd_acl_version[vers] = NULL;
+ nfsd_acl_versions[vers] = NULL;
#endif
break;
case NFSD_TEST:

2007-01-13 02:12:55

by Wu Fengguang

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Sat, Jan 13, 2007 at 06:43:07AM +1100, Neil Brown wrote:
>
> Ok, thanks. I must have missed something else wrong in the code......
>
> Probably this 'break' in the wrong place...
>
> Could you try this patch instead please - or just move the 'break' to
> where it should be.

Now it worked :)

Thanks,
Wu

> Signed-off-by: Neil Brown <[email protected]>
>
> ### Diffstat output
> ./fs/nfsd/nfssvc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff .prev/fs/nfsd/nfssvc.c ./fs/nfsd/nfssvc.c
> --- .prev/fs/nfsd/nfssvc.c 2007-01-11 14:55:38.000000000 +1100
> +++ ./fs/nfsd/nfssvc.c 2007-01-13 06:40:12.000000000 +1100
> @@ -72,7 +72,7 @@ static struct svc_program nfsd_acl_progr
> .pg_prog = NFS_ACL_PROGRAM,
> .pg_nvers = NFSD_ACL_NRVERS,
> .pg_vers = nfsd_acl_versions,
> - .pg_name = "nfsd",
> + .pg_name = "nfsacl",
> .pg_class = "nfsd",
> .pg_stats = &nfsd_acl_svcstats,
> .pg_authenticate = &svc_set_client,
> @@ -118,16 +118,16 @@ int nfsd_vers(int vers, enum vers_op cha
> switch(change) {
> case NFSD_SET:
> nfsd_versions[vers] = nfsd_version[vers];
> - break;
> #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
> if (vers < NFSD_ACL_NRVERS)
> - nfsd_acl_version[vers] = nfsd_acl_version[vers];
> + nfsd_acl_versions[vers] = nfsd_acl_version[vers];
> #endif
> + break;
> case NFSD_CLEAR:
> nfsd_versions[vers] = NULL;
> #if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
> if (vers < NFSD_ACL_NRVERS)
> - nfsd_acl_version[vers] = NULL;
> + nfsd_acl_versions[vers] = NULL;
> #endif
> break;
> case NFSD_TEST:

2007-01-14 22:33:23

by NeilBrown

[permalink] [raw]
Subject: Re: "svc: unknown version (3)" when CONFIG_NFSD_V4=y

On Saturday January 13, [email protected] wrote:
> On Sat, Jan 13, 2007 at 06:43:07AM +1100, Neil Brown wrote:
> >
> > Ok, thanks. I must have missed something else wrong in the code......
> >
> > Probably this 'break' in the wrong place...
> >
> > Could you try this patch instead please - or just move the 'break' to
> > where it should be.
>
> Now it worked :)

Thanks. I'll try to get those fixes into 2.6.20...

NeilBrown