Skip to content

Commit 399f11c

Browse files
Bryan SchumakerTrond Myklebust
authored andcommitted
NFS: Wait for session recovery to finish before returning
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> Cc: stable@vger.kernel.org
1 parent 08f05c4 commit 399f11c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/nfs/nfs4proc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ static int nfs4_handle_exception(struct nfs_server *server, int errorcode, struc
339339
dprintk("%s ERROR: %d Reset session\n", __func__,
340340
errorcode);
341341
nfs4_schedule_session_recovery(clp->cl_session, errorcode);
342-
exception->retry = 1;
343-
break;
342+
goto wait_on_recovery;
344343
#endif /* defined(CONFIG_NFS_V4_1) */
345344
case -NFS4ERR_FILE_OPEN:
346345
if (exception->timeout > HZ) {

0 commit comments

Comments
 (0)