[kernel] r14369 - in dists/lenny/linux-2.6/debian: . patches/bugfix/all patches/series

Ben Hutchings benh at alioth.debian.org
Sat Oct 10 01:10:08 UTC 2009


Author: benh
Date: Sat Oct 10 01:10:05 2009
New Revision: 14369

Log:
nfs: Handle -ESTALE error in access() (Closes: #508866)

Added:
   dists/lenny/linux-2.6/debian/patches/bugfix/all/nfs-handle-ESTALE-error-in-access.patch
Modified:
   dists/lenny/linux-2.6/debian/changelog
   dists/lenny/linux-2.6/debian/patches/series/20

Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog	Fri Oct  9 13:18:00 2009	(r14368)
+++ dists/lenny/linux-2.6/debian/changelog	Sat Oct 10 01:10:05 2009	(r14369)
@@ -19,6 +19,7 @@
   * proc: Fix truncation of entries in /proc/*/pagemap on 32-bit
     architectures (Closes: #511419)
   * Sanitise <linux/socket.h> and <linux/uio.h> (Closes: #538372)
+  * nfs: Handle -ESTALE error in access() (Closes: #508866)
 
   [ dann frazier ]
   * autofs4: don't make expiring dentry negative, avoiding an oops

Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/nfs-handle-ESTALE-error-in-access.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/nfs-handle-ESTALE-error-in-access.patch	Sat Oct 10 01:10:05 2009	(r14369)
@@ -0,0 +1,71 @@
+From a71ee337b31271e701f689d544b6153b75609bc5 Mon Sep 17 00:00:00 2001
+From: Suresh Jayaraman <sjayaraman at suse.de>
+Date: Tue, 10 Mar 2009 20:33:21 -0400
+Subject: [PATCH] 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 at suse.de>
+Signed-off-by: Trond Myklebust <Trond.Myklebust at netapp.com>
+---
+ fs/nfs/dir.c |    8 +++++++-
+ 1 files changed, 7 insertions(+), 1 deletions(-)
+
+diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
+index e35c819..672368f 100644
+--- a/fs/nfs/dir.c
++++ b/fs/nfs/dir.c
+@@ -1892,8 +1892,14 @@ static int nfs_do_access(struct inode *inode, struct rpc_cred *cred, int mask)
+ 	cache.cred = cred;
+ 	cache.jiffies = jiffies;
+ 	status = NFS_PROTO(inode)->access(inode, &cache);
+-	if (status != 0)
++	if (status != 0) {
++		if (status == -ESTALE) {
++			nfs_zap_caches(inode);
++			if (!S_ISDIR(inode->i_mode))
++				set_bit(NFS_INO_STALE, &NFS_I(inode)->flags);
++		}
+ 		return status;
++	}
+ 	nfs_access_add_cache(inode, &cache);
+ out:
+ 	if ((mask & ~cache.mask & (MAY_READ | MAY_WRITE | MAY_EXEC)) == 0)
+-- 
+1.6.4.3
+

Modified: dists/lenny/linux-2.6/debian/patches/series/20
==============================================================================
--- dists/lenny/linux-2.6/debian/patches/series/20	Fri Oct  9 13:18:00 2009	(r14368)
+++ dists/lenny/linux-2.6/debian/patches/series/20	Sat Oct 10 01:10:05 2009	(r14369)
@@ -12,4 +12,5 @@
 + bugfix/all/pagemap-fix-32-bit-pagemap-regression.patch
 + bugfix/all/sanitise-linux-socket-h.patch
 + bugfix/all/sanitise-linux-uio-h.patch
++ bugfix/all/nfs-handle-ESTALE-error-in-access.patch
 + features/all/ftdi_sio-openrd.patch



More information about the Kernel-svn-changes mailing list