Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 175754 - NFSv4: Error: state recovery failed on NFSv4 server 192.168.0.1 with error 121 when reading/writing files
Summary: NFSv4: Error: state recovery failed on NFSv4 server 192.168.0.1 with error 12...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High critical
Assignee: Network Filesystems
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-04-23 20:16 UTC by Jonas Jonsson
Modified: 2007-05-19 05:26 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Jonsson 2007-04-23 20:16:24 UTC
Hi.

I'm trying to setup a NFSv4 server, but I can't get it to work properly.

Short version: 
When I try to read a file on the NFSv4 server, it hangs and floods my kernel logs with "Error: state recovery failed on NFSv4 server 192.168.0.1 with error 121". However everything else seems to working, I can use ls and stat and the uid/gid is correct.

Long version:
I have compiled my kernel (2.6.20-gentoo-r6) with needed NFS stuff

$ cat /boot/config-2.6.20-gentoo-r6-1 | grep NFS

CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
CONFIG_NFS_V4=y
CONFIG_NFS_DIRECTIO=y
CONFIG_NFSD=m
CONFIG_NFSD_V3=y
# CONFIG_NFSD_V3_ACL is not set
CONFIG_NFSD_V4=y
CONFIG_NFSD_TCP=y
CONFIG_NFS_COMMON=y

I have loaded the modules
$ lsmod
Module                  Size  Used by
nfs                   246456  3 
nfsd                  251304  17 
exportfs                5568  1 nfsd
lockd                  66224  3 nfs,nfsd
sunrpc                159624  14 nfs,nfsd,lockd

I have installed the lates version of nfs-utils
$ sudo emerge -pv nfs-utils

[ebuild   R   ] net-fs/nfs-utils-1.0.12-r3  USE="-kerberos -nonfsv4 -tcpd" 0 kB 

I have setup a simple /etc/exports
$ cat /etc/exports 
/tmp    *(ro,sync,no_subtree_check,nohide,fsid=root)

I start the nfs server
$ sudo /etc/init.d/nfs start
 * Starting portmap ...                                                                                                              [ ok ]
 * Starting NFS statd ...                                                                                                            [ ok ]
 * Exporting NFS directories ...                                                                                                     [ ok ]
 * Starting NFS daemon ...                                                                                                           [ ok ]
 * Starting NFS mountd ...                                                                                                           [ ok ]

I start the rpc.idmapd
$ sudo /etc/init.d/rpc.idmapd start
 * Mounting RPC pipefs ...                                                                                                           [ ok ]
 * Starting idmapd ...                                                                                                               [ ok ]

I try to mount it
$ sudo mount -t nfs4 localhost:/ /mnt/nfs

Mounted nfs releated
$ mount -v
nfsd on /proc/fs/nfs type nfsd (rw)
rpc_pipefs on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
localhost:/ on /mnt/nfs type nfs4 (rw,addr=127.0.0.1)

Create a test file
$ echo "Hi" > /tmp/test

Check nfs mount
$ ls -la /mnt/nfs
drwxrwxrwt 5 root   root         776 23 apr 22.10 .
drwxr-xr-x 9 root   root         248 23 apr 20.33 ..
-rw------- 1 jonas  users          3 23 apr 22.10 test

Now we hang the proc by trying to read the file
$ cat /mnt/nfs/test

If I check my kernel logs I see this
Apr 23 22:08:06 [kernel] Error: state recovery failed on NFSv4 server 127.0.0.1 with error 121
                - Last output repeated 282317 times -

When I built up this test case I spotted that I get that error if stand in /mnt/nfs and do an ls



Reproducible: Always

Steps to Reproduce:
See above
Actual Results:  
Flooded kernel logs with this

Error: state recovery failed on NFSv4 server 192.168.0.1 with error 121

And sometimes single lines with this

Error: state recovery failed on NFSv4 server 192.168.0.1 with error 2


Expected Results:  
A working NFSv4 server

I have tested 3 different kernel version on the server, 2.6.20-gentoo-r6, Vanilla 2.6.21_rc7 and 2.6.21_rc7-git5, Same result.

On my client machine I have managed to get a working NFSv4 server which can mount it's own nfs. I can even from the server machine mount the client machines nfs exports.

So my guess is that it's something wrong in the NFSD part on the server machine.

The server machine is running ResierFS on top of LVM on top of RAID5. But I have tried with a external USB stick and it's the same problem.

$ sudo emerge --info
Portage 2.1.2.2 (default-linux/amd64/2006.1, gcc-4.1.1, glibc-2.5-r0, 2.6.20-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.20-gentoo-r6 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+
Gentoo Base System release 1.12.9
Timestamp of tree: Sat, 21 Apr 2007 15:50:01 +0000
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.15-r1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=athlon64"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/php/apache1-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=athlon64"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="sv_SE.UTF-8"
LC_ALL="sv_SE.UTF-8"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/webapps-experimental"
SYNC="rsync://rsync.gentoo.se/gentoo-portage"
USE="alsa amd64 apache2 berkdb bitmap-fonts bzip2 cli cracklib crypt dri dvb fortran gd gdbm iconv isdnlog jpeg ldap libg++ midi mysql ncurses nls nolvm1 nptl nptlonly opengl pam pcre perl png ppds pppd python readline reflection samba session spl ssl threads truetype truetype-fonts type1-fonts unicode vhosts vorbis xml xml2 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 SpanKY gentoo-dev 2007-05-19 05:26:13 UTC
try with nfs-utils-1.1.0

if that doesnt work, please seek help on the nfs lists