Skip to content

Commit

Permalink
NFS: When state recovery fails, waiting tasks should exit
Browse files Browse the repository at this point in the history
NFSv4 state recovery is not always successful.  Failure is signalled
by setting the nfs_client.cl_cons_state to a negative (errno) value,
then waking waiters.

Currently this can happen only during mount processing.  I'm about to
add an explicit case where state recovery failure during normal
operation should force all NFS requests waiting on that state recovery
to exit.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jul 16, 2012
1 parent 6a1a1e3 commit 46a87b8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ static int nfs4_wait_clnt_recover(struct nfs_client *clp)

res = wait_on_bit(&clp->cl_state, NFS4CLNT_MANAGER_RUNNING,
nfs_wait_bit_killable, TASK_KILLABLE);
return res;
if (res)
return res;

if (clp->cl_cons_state < 0)
return clp->cl_cons_state;
return 0;
}

static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
Expand Down

0 comments on commit 46a87b8

Please sign in to comment.