Re: [PATCH] rust: add task_work abstraction
From: Greg KH
Date: Wed Apr 22 2026 - 01:37:21 EST
On Wed, Apr 22, 2026 at 12:31:17AM +0000, Ashutosh Desai wrote:
> On Tue, Apr 21, 2026 at 08:44:01AM +0200, Greg KH wrote:
> > Do you have a user for this binding so that we can see how it is being
> > used to determine if it is correct?
>
> The motivating user is drivers/android/binder/deferred_close.rs, which
> calls bindings::init_task_work() and bindings::task_work_add() directly.
>
> Converting it is non-trivial - the current code schedules the task work
> before closing the fd on purpose, so it can bail out if scheduling fails
> without having already removed the fd. Our API requires the data to be
> ready before calling add(), which would reverse that order and change the
> error semantics of close_fd().
>
> Happy to send a v2 with a conversion patch if that is the preferred
> approach, or to discuss the design first if needed.
Having a user of it is key to see if the new api actually does work well
or not. On it's own, it can be hard to determine.
thanks,
greg k-h