Re: [PATCH v2] rust_binder: check context manager before creating node
From: Alice Ryhl
Date: Tue Jul 21 2026 - 03:35:01 EST
On Thu, Jun 18, 2026 at 2:12 PM Keshav Verma <iganschel@xxxxxxxxx> 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 <iganschel@xxxxxxxxx>
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