[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210801092050.6322-1-lizhijian@cn.fujitsu.com>
Date: Sun, 1 Aug 2021 17:20:50 +0800
From: Li Zhijian <lizhijian@...fujitsu.com>
To: <leon@...nel.org>, <dledford@...hat.com>, <jgg@...pe.ca>,
<linux-rdma@...r.kernel.org>, <linux-kernel@...r.kernel.org>
CC: Li Zhijian <lizhijian@...fujitsu.com>
Subject: [PATCH] RDMA/mlx5: return the EFAULT per ibv_advise_mr(3)
ibv_advise_mr(3) says:
EFAULT In one of the following: o When the range requested is out of the MR bounds,
or when parts of it are not part of the process address space. o One of the
lkeys provided in the scatter gather list is invalid or with wrong write access
Actually get_prefetchable_mr() will return NULL if it see above conditions
Signed-off-by: Li Zhijian <lizhijian@...fujitsu.com>
---
drivers/infiniband/hw/mlx5/odp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/mlx5/odp.c b/drivers/infiniband/hw/mlx5/odp.c
index d0d98e584ebc..8d2a626c87cf 100644
--- a/drivers/infiniband/hw/mlx5/odp.c
+++ b/drivers/infiniband/hw/mlx5/odp.c
@@ -1791,7 +1791,7 @@ static int mlx5_ib_prefetch_sg_list(struct ib_pd *pd,
mr = get_prefetchable_mr(pd, advice, sg_list[i].lkey);
if (!mr)
- return -ENOENT;
+ return -EFAULT;
ret = pagefault_mr(mr, sg_list[i].addr, sg_list[i].length,
&bytes_mapped, pf_flags);
if (ret < 0) {
--
2.30.2
Powered by blists - more mailing lists