]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NFSoRDMA: for local permissions, pull lkey value from the correct ib_mr
authorTodd Vierling <todd.vierling@oracle.com>
Mon, 23 Nov 2015 15:08:44 +0000 (10:08 -0500)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Thu, 26 Nov 2015 04:07:52 +0000 (20:07 -0800)
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 <todd.vierling@oracle.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
net/sunrpc/xprtrdma/fmr_ops.c

index cb25c89da6239154475d6c31736e328d13f19134..2d6bb5856063a90999f742bf227718145f520126 100644 (file)
@@ -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;
        }