diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-10-28 16:42:44 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-10-28 16:46:37 -0400 |
commit | 34751b9d04a221da2a74b27ba439f01c0ae30069 (patch) | |
tree | 69c3aa663909cbd6fb45bdf55d2ff6ad9d78272c | |
parent | 4d4b69dd847a098cdca341c45326f6c6f61b8691 (diff) |
SUNRPC: Add correct rcu_dereference annotation in rpc_clnt_set_transport
rpc_clnt_set_transport should use rcu_derefence_protected(), as it is
only safe to be called with the rpc_clnt::cl_lock held.
Cc: Chuck Lever <Chuck.Lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | net/sunrpc/clnt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index f167d9c8d7dd..759b78b056a7 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -272,7 +272,8 @@ static struct rpc_xprt *rpc_clnt_set_transport(struct rpc_clnt *clnt, | |||
272 | struct rpc_xprt *old; | 272 | struct rpc_xprt *old; |
273 | 273 | ||
274 | spin_lock(&clnt->cl_lock); | 274 | spin_lock(&clnt->cl_lock); |
275 | old = clnt->cl_xprt; | 275 | old = rcu_dereference_protected(clnt->cl_xprt, |
276 | lockdep_is_held(&clnt->cl_lock)); | ||
276 | 277 | ||
277 | if (!xprt_bound(xprt)) | 278 | if (!xprt_bound(xprt)) |
278 | clnt->cl_autobind = 1; | 279 | clnt->cl_autobind = 1; |