提交 9b1ba1b8 编写于 作者: X Xiao Yang 提交者: Yang Yingliang

RDMA/rxe: Don't overwrite errno from ib_umem_get()

stable inclusion
from linux-4.19.198
commit 92aa20a768b4a1b30242801c39d61b51c6127ffe

--------------------------------

[ Upstream commit 20ec0a6d ]

rxe_mr_init_user() always returns the fixed -EINVAL when ib_umem_get()
fails so it's hard for user to know which actual error happens in
ib_umem_get(). For example, ib_umem_get() will return -EOPNOTSUPP when
trying to pin pages on a DAX file.

Return actual error as mlx4/mlx5 does.

Link: https://lore.kernel.org/r/20210621071456.4259-1-ice_yangxiao@163.comSigned-off-by: NXiao Yang <yangx.jy@fujitsu.com>
Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 d34c90c6
...@@ -175,7 +175,7 @@ int rxe_mem_init_user(struct rxe_pd *pd, u64 start, ...@@ -175,7 +175,7 @@ int rxe_mem_init_user(struct rxe_pd *pd, u64 start,
if (IS_ERR(umem)) { if (IS_ERR(umem)) {
pr_warn("err %d from rxe_umem_get\n", pr_warn("err %d from rxe_umem_get\n",
(int)PTR_ERR(umem)); (int)PTR_ERR(umem));
err = -EINVAL; err = PTR_ERR(umem);
goto err1; goto err1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册