Commit 03c78827 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Fix races between socket connection and destroy code

When we're destroying the socket transport, we need to ensure that
we cancel any existing delayed connection attempts, and order them
w.r.t. the call to xs_close().
Reported-by: default avatar"Suzuki K. Poulose" <suzuki.poulose@arm.com>
Acked-by: default avatarJeff Layton <jlayton@poochiereds.net>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 048883e0
...@@ -881,8 +881,11 @@ static void xs_xprt_free(struct rpc_xprt *xprt) ...@@ -881,8 +881,11 @@ static void xs_xprt_free(struct rpc_xprt *xprt)
*/ */
static void xs_destroy(struct rpc_xprt *xprt) static void xs_destroy(struct rpc_xprt *xprt)
{ {
struct sock_xprt *transport = container_of(xprt,
struct sock_xprt, xprt);
dprintk("RPC: xs_destroy xprt %p\n", xprt); dprintk("RPC: xs_destroy xprt %p\n", xprt);
cancel_delayed_work_sync(&transport->connect_worker);
xs_close(xprt); xs_close(xprt);
xs_xprt_free(xprt); xs_xprt_free(xprt);
module_put(THIS_MODULE); module_put(THIS_MODULE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment