Re: [PATCH] SUNRPC: Fix a backchannel deadlock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Trond-


On Jul 22, 2015, at 4:36 PM, Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> wrote:

> xprt_alloc_bc_request() cannot call xprt_free_bc_request() without
> deadlocking, since it already holds the xprt->bc_pa_lock.
> 
> Reported-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> Fixes: 0d2a970d0ae55 ("SUNRPC: Fix a backchannel race")
> Signed-off-by: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx>

That’s exactly what I did as a basic fix, and I can report that
it successfully avoids the deadlock.

If xprt_alloc_bc_request() no longer calls xprt_free_bc_request(),
are the accounting changes introduced by 0d2a970d0ae55 still
necessary?


> ---
> net/sunrpc/backchannel_rqst.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sunrpc/backchannel_rqst.c b/net/sunrpc/backchannel_rqst.c
> index 9825ff0f91d6..5a3b50aec397 100644
> --- a/net/sunrpc/backchannel_rqst.c
> +++ b/net/sunrpc/backchannel_rqst.c
> @@ -240,8 +240,8 @@ static struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt, __be32 xid)
> 		req = xprt_alloc_bc_req(xprt, GFP_ATOMIC);
> 		if (!req)
> 			goto not_found;
> -		/* Note: this 'free' request adds it to xprt->bc_pa_list */
> -		xprt_free_bc_request(req);
> +		list_add_tail(&req->rq_bc_pa_list, &xprt->bc_pa_list);
> +		xprt->bc_alloc_count++;
> 	}
> 	req = list_first_entry(&xprt->bc_pa_list, struct rpc_rqst,
> 				rq_bc_pa_list);
> -- 
> 2.4.3
> 

--
Chuck Lever



--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux