From: Maher Sanalla <msanalla@nvidia.com>
To: Jason Gunthorpe <jgg@nvidia.com>, Leon Romanovsky <leon@kernel.org>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [PATCH rdma-next v1] RDMA/uverbs: Propagate errors from rdma_lookup_get_uobject()
Date: Fri, 28 Feb 2025 18:42:40 +0200 [thread overview]
Message-ID: <fc82feb9-3c96-4ead-9f35-59d228b1942b@nvidia.com> (raw)
In-Reply-To: <20250227205743.GO39591@nvidia.com>
On 27/02/2025 22:57, Jason Gunthorpe wrote:
> On Wed, Feb 26, 2025 at 03:54:13PM +0200, Leon Romanovsky wrote:
>> From: Maher Sanalla <msanalla@nvidia.com>
>>
>> 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.
>
> I still didn't see an answer to the question of why userspace would
> hit an EBUSY down that path in a way we need to care about? That is
> doing dumb racing thread stuff that nothing should be doing..
>
The issue isn't about whether userspace should hit EBUSY, but about
ensuring proper error reporting when it does. While hitting EBUSY might
result from racing threads or misuse, masking the actual error as EINVAL
makes debugging more difficult theoretically.
Maybe this example should be removed from commit-msg?
>> 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.
>
> I don't understand this sentence
>
> Is this the defence of why it is safe to do this? But if the rdma-core
> overrides them what is the point of forwarding?
>
> Jason
Yes. Most cases error is passed as is, only in a few cases the kernel
error is overridden (such as alloc_dm_steering_sw_icm()).
next prev parent reply other threads:[~2025-02-28 16:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 13:54 [PATCH rdma-next v1] RDMA/uverbs: Propagate errors from rdma_lookup_get_uobject() Leon Romanovsky
2025-02-27 20:57 ` Jason Gunthorpe
2025-02-28 16:42 ` Maher Sanalla [this message]
2025-03-13 12:26 ` Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fc82feb9-3c96-4ead-9f35-59d228b1942b@nvidia.com \
--to=msanalla@nvidia.com \
--cc=jgg@nvidia.com \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox