projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a58e0be
)
NFSv4: Fix a memory leak in nfs4_discover_server_trunking
author
Trond Myklebust
<
[email protected]
>
Thu, 4 Apr 2013 19:55:00 +0000
(15:55 -0400)
committer
Trond Myklebust
<
[email protected]
>
Fri, 5 Apr 2013 20:59:15 +0000
(16:59 -0400)
When we assign a new rpc_client to clp->cl_rpcclient, we need to destroy
the old one.
Signed-off-by: Trond Myklebust <
[email protected]
>
Cc: Chuck Lever <
[email protected]
>
Cc:
[email protected]
[>=3.7]
fs/nfs/nfs4state.c
patch
|
blob
|
history
diff --git
a/fs/nfs/nfs4state.c
b/fs/nfs/nfs4state.c
index 6ace365c6334db844af0c2c3f221cd871ef3658c..d41a3518509fa5a0cf1dbbdcbed87f39fa3eff45 100644
(file)
--- a/
fs/nfs/nfs4state.c
+++ b/
fs/nfs/nfs4state.c
@@
-1886,7
+1886,13
@@
again:
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: