]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - 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
CommitLineData
6d43f5ef
GKH
1From 399f11c3d872bd748e1575574de265a6304c7c43 Mon Sep 17 00:00:00 2001
2From: Bryan Schumaker <bjschuma@netapp.com>
3Date: Tue, 30 Oct 2012 16:06:35 -0400
4Subject: NFS: Wait for session recovery to finish before returning
5
6From: Bryan Schumaker <bjschuma@netapp.com>
7
8commit 399f11c3d872bd748e1575574de265a6304c7c43 upstream.
9
10Currently, we will schedule session recovery and then return to the
11caller of nfs4_handle_exception. This works for most cases, but causes
12a hang on the following test case:
13
14 Client Server
15 ------ ------
16 Open file over NFS v4.1
17 Write to file
18 Expire client
19 Try to lock file
20
21The server will return NFS4ERR_BADSESSION, prompting the client to
22schedule recovery. However, the client will continue placing lock
23attempts and the open recovery never seems to be scheduled. The
24simplest solution is to wait for session recovery to run before retrying
25the lock.
26
27Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
28Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
29Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30
31---
32 fs/nfs/nfs4proc.c | 3 +--
33 1 file changed, 1 insertion(+), 2 deletions(-)
34
35--- a/fs/nfs/nfs4proc.c
36+++ b/fs/nfs/nfs4proc.c
37@@ -331,8 +331,7 @@ static int nfs4_handle_exception(struct
38 dprintk("%s ERROR: %d Reset session\n", __func__,
39 errorcode);
40 nfs4_schedule_session_recovery(clp->cl_session, errorcode);
41- exception->retry = 1;
42- break;
43+ goto wait_on_recovery;
44 #endif /* defined(CONFIG_NFS_V4_1) */
45 case -NFS4ERR_FILE_OPEN:
46 if (exception->timeout > HZ) {