Bugzilla – Bug 959211
mount.nfs fails when using SLE12-SP1 kernel
Last modified: 2016-02-18 06:05:14 UTC
I booted SLE12-SP1 kernel on TW system for checking NFS bugs, then I noticed that mount.nfs fails like: % mount dist.suse.de:/dist /dist mount.nfs: an incorrect mount option was specified The strace shows that it gets EINVAL from mount syscall. mount("dist.suse.de:/dist", "/dist", "nfs", MS_RDONLY, "vers=4.2,addr=10.160.0.100,clien"...) = -1 EINVAL (Invalid argument) I know SLE12-SP1 kernel is no supported kernel for TW, but it's still inconvenient and looks buggy to me.
Certainly looks like a bug somewhere. The "MS_READONLY" looks a bit odd. Can you run the 'strace' with '-s 200' or similar so we get all of the mount options? I'll try my self at some stage....
(In reply to Neil Brown from comment #1) > Certainly looks like a bug somewhere. > The "MS_READONLY" looks a bit odd. It's likely because I invoked with -r option, sorry for confusion. But the result is same no matter whether with or without -r option. > Can you run the 'strace' with '-s 200' or similar so we get all of the mount > options? mount("dist.suse.de:/dist", "/dist", "nfs", 0, "vers=4.2,addr=10.160.0.100,clientaddr=10.0.2.15") = -1 EINVAL (Invalid argument) It seems that SLE12-SP1 kernel doesn't support NFS 4.2 while mount.nfs tries to use it?
I confirmed that the latest Linus tree shows the same problem when built without CONFIG_NFS_V4_2. Without CONFIG_NFS_V4_2, the kernel returns -EINVAL when vers=4.2 is passed (which is default). Meanwhile, mount.nfs has a fallback mechanism in nfs_autonegotiate(), but it happens only when EPROTONOSUPPORT is returned. So, a hackish kernel patch like below makes the fallback working: --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -187,7 +187,7 @@ struct nfs_client *nfs4_alloc_client(const struct nfs_client_initdata *cl_init) goto error; if (cl_init->minorversion > NFS4_MAX_MINOR_VERSION) { - err = -EINVAL; + err = -EPROTONOSUPPORT; /* let mount.nfs negotiate */ goto error; } But it might be better to fix nfs-utils side instead.
This has been fixed upstream and in Base:System It should flow through in due course.