android_kernel_xiaomi_sm8350/fs/nfs
Suresh Jayaraman a71ee337b3 NFS: Handle -ESTALE error in access()
Hi Trond,

I have been looking at a bugreport where trying to open applications on KDE
on a NFS mounted home fails temporarily. There have been multiple reports on
different kernel versions pointing to this common issue:
http://bugzilla.kernel.org/show_bug.cgi?id=12557
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/269954
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508866.html

This issue can be reproducible consistently by doing this on a NFS mounted
home (KDE):
1. Open 2 xterm sessions
2. From one of the xterm session, do "ssh -X <remote host>"
3. "stat ~/.Xauthority" on the remote SSH session
4. Close the two xterm sessions
5. On the server do a "stat ~/.Xauthority"
6. Now on the client, try to open xterm
This will fail.

Even if the filehandle had become stale, the NFS client should invalidate
the cache/inode and should repeat LOOKUP. Looking at the packet capture when
the failure occurs shows that there were two subsequent ACCESS() calls with
the same filehandle and both fails with -ESTALE error.

I have tested the fix below. Now the client issue a LOOKUP after the
ACCESS() call fails with -ESTALE. If all this makes sense to you, can you
consider this for inclusion?

Thanks,


If the server returns an -ESTALE error due to stale filehandle in response to
an ACCESS() call, we need to invalidate the cache and inode so that LOOKUP()
can be retried. Without this change, the nfs client retries ACCESS() with the
same filehandle, fails again and could lead to temporary failure of
applications running on nfs mounted home.

Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2009-03-10 20:33:21 -04:00
..
callback_proc.c
callback_xdr.c
callback.c
callback.h
client.c
delegation.c
delegation.h
dir.c NFS: Handle -ESTALE error in access() 2009-03-10 20:33:21 -04:00
direct.c
file.c fs: symlink write_begin allocation context fix 2009-01-04 13:33:20 -08:00
getroot.c
idmap.c
inode.c
internal.h
iostat.h
Kconfig fs/Kconfig: move nfs out 2009-01-22 13:16:00 +03:00
Makefile
mount_clnt.c
namespace.c
nfs2xdr.c
nfs3acl.c NFSv3: Fix posix ACL code 2009-03-10 20:33:18 -04:00
nfs3proc.c
nfs3xdr.c NFSv3: Fix posix ACL code 2009-03-10 20:33:18 -04:00
nfs4_fs.h fs/nfs/nfs4proc.c: make nfs4_map_errors() static 2008-12-30 16:35:55 -05:00
nfs4namespace.c NFS: Fix misparsing of nfsv4 fs_locations attribute (take 2) 2009-03-10 20:33:17 -04:00
nfs4proc.c fs/nfs/nfs4proc.c: make nfs4_map_errors() static 2008-12-30 16:35:55 -05:00
nfs4renewd.c
nfs4state.c
nfs4xdr.c
nfsroot.c Merge branch 'devel' into next 2008-12-30 16:51:43 -05:00
pagelist.c
proc.c
read.c
super.c Merge branch 'devel' into next 2008-12-30 16:51:43 -05:00
symlink.c
sysctl.c
unlink.c
write.c