From 40a3b3357f938fb045ff760099c9ec972b4f149e Mon Sep 17 00:00:00 2001 From: Trond Myklebust Date: Thu, 4 Apr 2013 15:55:00 -0400 Subject: [PATCH] --- yaml --- r: 362361 b: refs/heads/master c: b193d59a4863ea670872d76dc99231ddeb598625 h: refs/heads/master i: 362359: 08f9c02cd50911931fa49acd3b00b13ec6135149 v: v3 --- [refs] | 2 +- trunk/fs/nfs/nfs4state.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 2ad4579f559e..88a71c0a83b0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a58e0be6f6b3eb2079b0b8fedc9df6fa86869f1e +refs/heads/master: b193d59a4863ea670872d76dc99231ddeb598625 diff --git a/trunk/fs/nfs/nfs4state.c b/trunk/fs/nfs/nfs4state.c index 6ace365c6334..d41a3518509f 100644 --- a/trunk/fs/nfs/nfs4state.c +++ b/trunk/fs/nfs/nfs4state.c @@ -1886,7 +1886,13 @@ int nfs4_discover_server_trunking(struct nfs_client *clp, status = PTR_ERR(clnt); break; } - clp->cl_rpcclient = clnt; + /* Note: this is safe because we haven't yet marked the + * client as ready, so we are the only user of + * clp->cl_rpcclient + */ + clnt = xchg(&clp->cl_rpcclient, clnt); + rpc_shutdown_client(clnt); + clnt = clp->cl_rpcclient; goto again; case -NFS4ERR_MINOR_VERS_MISMATCH: