diff options
| author | Maher Sanalla <msanalla@nvidia.com> | 2025-02-26 15:54:13 +0200 |
|---|---|---|
| committer | Leon Romanovsky <leon@kernel.org> | 2025-03-13 08:26:37 -0400 |
| commit | 81f8f7454ad9e0bf95efdec6542afdc9a6ab1e24 (patch) | |
| tree | 242d63597b20157738c0cafac3461f62d7f50ac1 /include/rdma | |
| parent | bee35b7161aaaed9831e2f14876c374b9c566952 (diff) | |
| download | linux-81f8f7454ad9e0bf95efdec6542afdc9a6ab1e24.tar.gz linux-81f8f7454ad9e0bf95efdec6542afdc9a6ab1e24.tar.bz2 linux-81f8f7454ad9e0bf95efdec6542afdc9a6ab1e24.zip | |
RDMA/uverbs: Propagate errors from rdma_lookup_get_uobject()
Currently, the IB uverbs API calls uobj_get_uobj_read(), which in turn
uses the rdma_lookup_get_uobject() helper to retrieve user objects.
In case of failure, uobj_get_uobj_read() returns NULL, overriding the
error code from rdma_lookup_get_uobject(). The IB uverbs API then
translates this NULL to -EINVAL, masking the actual error and
complicating debugging. For example, applications calling ibv_modify_qp
that fails with EBUSY when retrieving the QP uobject will see the
overridden error code EINVAL instead, masking the actual error.
Furthermore, based on rdma-core commit:
"2a22f1ced5f3 ("Merge pull request #1568 from jakemoroni/master")"
Kernel's IB uverbs return values are either ignored and passed on as is
to application or overridden with other errnos in a few cases.
Thus, to improve error reporting and debuggability, propagate the
original error from rdma_lookup_get_uobject() instead of replacing it
with EINVAL.
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Link: https://patch.msgid.link/64f9d3711b183984e939962c2f83383904f97dfb.1740577869.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'include/rdma')
| -rw-r--r-- | include/rdma/uverbs_std_types.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/rdma/uverbs_std_types.h b/include/rdma/uverbs_std_types.h index fe0512116958..555ea3d142a4 100644 --- a/include/rdma/uverbs_std_types.h +++ b/include/rdma/uverbs_std_types.h @@ -34,7 +34,7 @@ static inline void *_uobj_get_obj_read(struct ib_uobject *uobj) { if (IS_ERR(uobj)) - return NULL; + return ERR_CAST(uobj); return uobj->object; } #define uobj_get_obj_read(_object, _type, _id, _attrs) \ |
