diff mbox series

[rdma-next] IB/mlx5: Set correct write permissions for implicit ODP MR

Message ID 20190225065300.31606-1-leon@kernel.org (mailing list archive)
State Mainlined
Commit 7095ec3ca00eba04553d4c323dc9dd160219dd68
Delegated to: Jason Gunthorpe
Headers show
Series [rdma-next] IB/mlx5: Set correct write permissions for implicit ODP MR | expand

Commit Message

Leon Romanovsky Feb. 25, 2019, 6:53 a.m. UTC
From: Moni Shoua <monis@mellanox.com>

The write access of an implicit MR is inherited to all of its children.
Therefore we must set the correct write access to the parent MR.

Pass full access_flags when creating umem to let it calculate write
access correctly.

Fixes: da6a496a34f2 ("IB/mlx5: Ranges in implicit ODP MR inherit its write access")
Signed-off-by: Moni Shoua <monis@mellanox.com>
Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/infiniband/hw/mlx5/odp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jason Gunthorpe March 4, 2019, 7:23 p.m. UTC | #1
On Mon, Feb 25, 2019 at 08:53:00AM +0200, Leon Romanovsky wrote:
> From: Moni Shoua <monis@mellanox.com>
> 
> The write access of an implicit MR is inherited to all of its children.
> Therefore we must set the correct write access to the parent MR.
> 
> Pass full access_flags when creating umem to let it calculate write
> access correctly.
> 
> Fixes: da6a496a34f2 ("IB/mlx5: Ranges in implicit ODP MR inherit its write access")
> Signed-off-by: Moni Shoua <monis@mellanox.com>
> Reviewed-by: Artemy Kovalyov <artemyko@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/hw/mlx5/odp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied to for-next thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
index d828c20af38c..c20bfc41ecf1 100644
--- a/drivers/infiniband/hw/mlx5/odp.c
+++ b/drivers/infiniband/hw/mlx5/odp.c
@@ -522,7 +522,7 @@  struct mlx5_ib_mr *mlx5_ib_alloc_implicit_mr(struct mlx5_ib_pd *pd,
 	struct mlx5_ib_mr *imr;
 	struct ib_umem *umem;
 
-	umem = ib_umem_get(udata, 0, 0, IB_ACCESS_ON_DEMAND, 0);
+	umem = ib_umem_get(udata, 0, 0, access_flags, 0);
 	if (IS_ERR(umem))
 		return ERR_CAST(umem);