]>
Commit | Line | Data |
---|---|---|
6d43f5ef GKH |
1 | From 399f11c3d872bd748e1575574de265a6304c7c43 Mon Sep 17 00:00:00 2001 |
2 | From: Bryan Schumaker <bjschuma@netapp.com> | |
3 | Date: Tue, 30 Oct 2012 16:06:35 -0400 | |
4 | Subject: NFS: Wait for session recovery to finish before returning | |
5 | ||
6 | From: Bryan Schumaker <bjschuma@netapp.com> | |
7 | ||
8 | commit 399f11c3d872bd748e1575574de265a6304c7c43 upstream. | |
9 | ||
10 | Currently, we will schedule session recovery and then return to the | |
11 | caller of nfs4_handle_exception. This works for most cases, but causes | |
12 | a 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 | ||
21 | The server will return NFS4ERR_BADSESSION, prompting the client to | |
22 | schedule recovery. However, the client will continue placing lock | |
23 | attempts and the open recovery never seems to be scheduled. The | |
24 | simplest solution is to wait for session recovery to run before retrying | |
25 | the lock. | |
26 | ||
27 | Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> | |
28 | Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> | |
29 | Signed-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) { |