From: Todd Vierling Date: Mon, 23 Nov 2015 15:08:44 +0000 (-0500) Subject: NFSoRDMA: for local permissions, pull lkey value from the correct ib_mr X-Git-Tag: v4.1.12-92~227^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6a14af209ad53feeeb97c311b3c18c0b71bf9ea1;p=users%2Fjedix%2Flinux-maple.git NFSoRDMA: for local permissions, pull lkey value from the correct ib_mr When not using local_dma_lkey, fmr_op_open() fetches a ib_mr associated with local write permission. This value is stuffed into the returned rpcrdma_ia, but ia->ri_dma_mr->lkey was accessed _before_ the ia->ri_dma_mr was updated. Fix this by pulling lkey directly from the newly fetched ib_mr rather than the value previously stored in ia->ri_dma_mr. Orabug: 22202841 Signed-off-by: Todd Vierling Reviewed-by: Chuck Lever --- diff --git a/net/sunrpc/xprtrdma/fmr_ops.c b/net/sunrpc/xprtrdma/fmr_ops.c index cb25c89da6239..2d6bb5856063a 100644 --- a/net/sunrpc/xprtrdma/fmr_ops.c +++ b/net/sunrpc/xprtrdma/fmr_ops.c @@ -54,7 +54,7 @@ fmr_op_open(struct rpcrdma_ia *ia, struct rpcrdma_ep *ep, __func__, PTR_ERR(mr)); return -ENOMEM; } - ia->ri_dma_lkey = ia->ri_dma_mr->lkey; + ia->ri_dma_lkey = mr->lkey; ia->ri_dma_mr = mr; }