Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 295552

Summary: net-fs/nfs-utils-1.2.1 breaks nfs mounts: "an incorrect mount option was specified"
Product: Gentoo Linux Reporter: ferret <ferret-bgo>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED OBSOLETE    
Severity: normal CC: bbutscheidt, benjamin1506, grubba, kfm, rodrigo, rossi.f, tom, vereecke.jan
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description ferret 2009-12-03 15:05:06 UTC
sudo mount kronos:/u3 foo
mount.nfs: an incorrect mount option was specified

in dmesg:

[  550.673773] NFS: bad mount option value specified: vers=4

There's no line in fstab.  Problem does not occur with 1.2.0.
Patch from #294994 doesn't fix.  Issue isn't the same as that one anyway.

$ emerge --info
Portage 2.2_rc54-r1 (unavailable, gcc-4.4.2, glibc-2.11-r0, 2.6.32-rc7 x86_64)
=================================================================
System uname: Linux-2.6.32-rc7-x86_64-AMD_Turion-tm-_64_Mobile_ML-34-with-gentoo-2.0.1
Timestamp of tree: Tue, 01 Dec 2009 18:45:01 +0000
app-shells/bash:     4.0_p35
dev-java/java-config: 2.1.9-r1
dev-lang/python:     2.6.4, 3.1.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.2-r2
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.64
sys-devel/automake:  1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA ut2003 dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=athlon64 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
FEATURES="assume-digests buildpkg collision-protect distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://gentoo.mirror.sdv.fr http://ftp.heanet.ie/pub/gentoo/"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="en_GB en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/junk /usr/local/portage/multilib-overlay"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac aalib acpi alsa amd64 avi bash-completion berkdb bittorrent bluetooth branding bzip2 cairo cdparanoia cdr cleartype cli cracklib crypt curl divx dri dvd dvdnav dvdr eds emboss encode evo fam fbcon ffmpeg firefox flac flash fontconfig ftp gdbm gif gmp gnutls gpm gtk gtk2 iconv id3 imap imlib java javascript jikes jpeg kpathsea lame libcaca libnl libnotify libwww lua lzo mad mikmod mmx mmxext mng modules motif mp3 mp4 mpeg mudflap multilib music ncurses nptl nptlonly nss ogg oggvorbis opengl openmp openssl pcre pdf pdflib perl png ppds python quicktime readline reflection rtc samba sdl session spell spl sse sse2 ssl svg sysfs tcpd theora thunar tiff truetype unicode usb videos vim-syntax vorbis wmf x264 xcb xft xml xml2 xorg xosd xulrunner xv xvid zlib" ALSA_CARDS="atiixp" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="ncurses text" LINGUAS="en_GB en" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon vesa" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 ferret 2009-12-03 15:12:10 UTC
Should add: no, I don't have nfs v4 support in my kernel.  Didn't need it yesterday... :)
Comment 2 ferret 2009-12-03 15:26:33 UTC
Tried relevant-looking post-1.2.1 upstream patch:

http://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commitdiff;h=2498a68b1bec01d0ee8a63962b314140e8289036

But, did not help.
Comment 3 Rafał Mużyło 2009-12-09 15:14:56 UTC
I suspect it's a case of bad default.
Check your nfsmount.conf.
If that fails, you can always try adding 'vers=3' to your mount options.
Comment 4 ferret 2009-12-10 01:22:36 UTC
Don't have a nfsmount.conf
Don't have any files in /etc that mention vers=
Since it starts happenening between 1.2.0 and 1.2.1 I diffed the files from those two packages.
The only differences are in the compiled binaries, and doc/man pages.  So it is not a configuration issue.  The change is in the code.
Comment 5 Rafał Mużyło 2009-12-10 02:14:00 UTC
'vers=3' was meant for fstab. In the other bug, that helped.
Though I think there should be nfsmount.conf laying around somewhere.

(I suspect (after looking at nfs-utils code),
that you're simply hitting a code branch, that
you could have before)
Comment 6 Marian Kyral 2010-01-01 20:07:17 UTC
Hi,
I have the same problem. I mount nfs disks with autofs. Problems started with kernel 2.6.32. When I boot 2.6.31, nfs mount works again.

I tried to compile nfsv4 into kernel. The error message disappear from log, but still not mount. Then I added "vers=3" to autofs config, restart it and nfs works again.

So it looks like the default nsf version was changed in 2.6.32. If it is not specified, v4 is used.
Comment 7 Rafał Mużyło 2010-01-02 00:31:40 UTC
It's the other way around:
in nfs-utils code there's a version check,
that makes v4 default if running on >=2.6.32.
Comment 8 Bernd Butscheidt 2010-07-11 19:20:23 UTC
Same here after update of kernel 2.6.31 and again,adding 

vers=3

to the mount options helped.




Comment 9 Plüss Roland 2011-03-20 16:38:09 UTC
(In reply to comment #7)
> It's the other way around:
> in nfs-utils code there's a version check,
> that makes v4 default if running on >=2.6.32.
But v4 is still marked as EXPERIMENTAL in 2.6.36 I use here. Turning an unstable(experimental) code as default? Isn't this a system breaker? I hit the same problem not being able to mount nfs anymore since recent update of nfs ebuilds.
Comment 10 Rodrigo Severo 2011-03-29 18:32:00 UTC
I make Plüss words mine.

People simply updating their systems to packages marked as stable are getting their nfs mounts broken because nfs-utils _forces_ NFS 4 use despite NFS 4 being marked as experimental in the kernel and despite the instructions available at "man 5 nfs" on the "nfsvers" option:

"If this option is not specified, the client negociate a suitable version with the server, trying version 4 first, version 3 second, and version 2 last."

What is really happening with net-fs/nfs-utils-1.2.3-r1 is that nfs version 4 is being forced, and when it fails for lack of support on the server side, for example, the mount fails completely.

Just to complete this report, it seems that including the option "nfsvers=3" in each nfs mount in /etc/fstab can prevent nfs-utils from forcing NFS 4 on the mount request.

I also included "-nfsvers4" in my use flags. I'm not sure this is really necessary but I'm just trying to be on the safe side here as non-working nfs mounts are really troublesome.

This bug has more than a year and even with this info available net-fs/nfs-utils-1.2.3-r1 was marked as stable. Why create havok on nfs users this way?
Comment 11 Rodrigo Severo 2011-03-30 21:48:10 UTC
I believe I finally discovered the problem here. It seems to be two-fold. nfs-utils 1.2.3-r1 tries a NFS 4 connection even if

1. there is no NFS 4 client support in the kernel
2. there is a -nfsver4 USE flag defined.

I believe the ebuild should check for these two conditions. If any of them is present, a NFS 4 connection should not be even tried.

After including NFS 4 client support in the client kernel my NFS mounts are working even without NFS 4 server support in the server kernel.
Comment 12 Denis Scherbakov 2011-04-05 15:16:11 UTC
The error is reported by fs/nfs/super.c in Linux kernel, when version4 protocol is used and NFS4 support was not built-in.
Interaction with a kernel module is performed by mount.nfs from nfs-utils.
When no NFS version was specified, nfs_try_mount in stropts.c calls nfs_autonegociate, which tries to use NFSv4 first.
When no NFSv4 support is built-in, errno is set to 22=EINVAL
This special case is not handled by nfs_autonegociate and it aborts with error. Hence, mount with NFSv3 is never tried.

BUGS:
 - nfs-utils uses NFSv4 even when --enable-nfsv4 option was not specified.
 - in fact, --enable-nfsv4 has almost no effect
 - nfs-utils does not handle EINVAL errno value.

SOLUTION:
 - recompile kernel and add NFSv4 support even if you do not use it.
 - add nfsvers=3 (or vers=3) to mount options

TODO:
 - in case of autofs with ldap I don't know what to modify to get nfsvers=3 appended to mount options
Comment 13 Henrik Grubbström 2011-04-05 18:35:38 UTC
I just noticed the following:

| # strings /sbin/mount.nfs | grep vers
|         -V              Print version
| %s: requested NFS version or transport protocol is not supported
| nfsvers
| mountvers
| %s: parsing error on 'vers=' option
| %s: invalid value for 'vers=' option
| %s: parsing error on 'nfsvers=' option
| %s: invalid value for 'nfsvers=' option
| %s: trying %s prog %lu vers %lu prot %s port %d
| %s: prog %lu, trying vers=%lu, prot=%u
| %s: invalid value for 'mountvers=' option
| %s: Please use '-t nfs4' instead of '-o vers=4'
| %s: NFS version %ld is not supported
| %s: NFS mount version %ld is not supported
| %s: pinging: prog %d vers %d prot %s port %d
| mountvers=%lu
| vers=4
|   NOTE: this default has changed since nfs-utils version 1.0.x

Note the next to last line...
Editing the binary and changing that 'vers=4' to 'vers=3' solved my immediate problem (nfs mounting of auto_home).
Comment 14 Henrik Grubbström 2011-05-05 16:06:22 UTC
net-fs/nfs-utils-1.2.3-r1 is still broken.
Comment 15 Tom Noonan 2011-05-10 14:54:01 UTC
These new nfs-utils packages break functionality and should not be marked stable.  Please mark them ~arch.