Re: [PATCH v2] rust_binder: check context manager before creating node

Alice Ryhl <[email protected]>
Newsgroups org.kernel.vger.rust-for-linux,org.kernel.vger.linux-kernel
Message-ID <CAH5fLggj_=zKfuanDSTJv2LVVCLnAJt7TD0yT8yqEDpakCh5Cg@mail.gmail.com>
On Thu, Jun 18, 2026 at 2:12 PM Keshav Verma <[email protected]> wrote:
>
> Rust Binder currently creates the Binder node before checking whether a
> context manager is already registered. If a context manager already exists,
> set_manager_node() returns -EBUSY after node state has already been created.
>
> Add a check before creating the node to match the C Binder ordering for
> the common already registered case. Keep the final checks in set_manager_node()
> so races with another caller are still handled after node creation.
>
> Signed-off-by: Keshav Verma <[email protected]>

Honestly, I don't think we should make this change. It duplicates
logic to optimize for a case that doesn't exist in practice. I'd
prefer to avoid the code duplication this causes, than I want to
optimize for a codepath nobody ever hits in practice.

Alice
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.