]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blobdiff - releases/3.6.7/nfs-wait-for-session-recovery-to-finish-before-returning.patch
Linux 3.6.7
[thirdparty/kernel/stable-queue.git] / releases / 3.6.7 / nfs-wait-for-session-recovery-to-finish-before-returning.patch
diff --git a/releases/3.6.7/nfs-wait-for-session-recovery-to-finish-before-returning.patch b/releases/3.6.7/nfs-wait-for-session-recovery-to-finish-before-returning.patch
new file mode 100644 (file)
index 0000000..151c55c
--- /dev/null
@@ -0,0 +1,46 @@
+From 399f11c3d872bd748e1575574de265a6304c7c43 Mon Sep 17 00:00:00 2001
+From: Bryan Schumaker <bjschuma@netapp.com>
+Date: Tue, 30 Oct 2012 16:06:35 -0400
+Subject: NFS: Wait for session recovery to finish before returning
+
+From: Bryan Schumaker <bjschuma@netapp.com>
+
+commit 399f11c3d872bd748e1575574de265a6304c7c43 upstream.
+
+Currently, we will schedule session recovery and then return to the
+caller of nfs4_handle_exception.  This works for most cases, but causes
+a hang on the following test case:
+
+       Client                          Server
+       ------                          ------
+       Open file over NFS v4.1
+       Write to file
+                                       Expire client
+       Try to lock file
+
+The server will return NFS4ERR_BADSESSION, prompting the client to
+schedule recovery.  However, the client will continue placing lock
+attempts and the open recovery never seems to be scheduled.  The
+simplest solution is to wait for session recovery to run before retrying
+the lock.
+
+Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/nfs4proc.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -331,8 +331,7 @@ static int nfs4_handle_exception(struct
+                       dprintk("%s ERROR: %d Reset session\n", __func__,
+                               errorcode);
+                       nfs4_schedule_session_recovery(clp->cl_session, errorcode);
+-                      exception->retry = 1;
+-                      break;
++                      goto wait_on_recovery;
+ #endif /* defined(CONFIG_NFS_V4_1) */
+               case -NFS4ERR_FILE_OPEN:
+                       if (exception->timeout > HZ) {