Re: [PATCH v2] rust: configfs: require thread-safe callback data
From: Andreas Hindborg
Date: Tue Sep 29 2026 - 06:28:38 EST
On Mon, 14 Sep 2026 14:09:00 +0000, Yilin Chen wrote:
> The Rust configfs abstractions do not fully constrain callback data for
> cross-thread use. Add the missing `Send` and `Sync` requirements.
>
> Specifically, make the following changes:
>
> 1. Require `Data: Send` when implementing `Send` for `Subsystem<Data>`,
> since the subsystem stores its data by value.
> 2. Make `GroupOperations` a `Sync` supertrait because `make_group` and
> `drop_item` receive `&self` from foreign threads. Require `Child: Send`
> because configfs may release child groups on an arbitrary thread.
> 3. Require `AttributeOperations::Data: Sync` because its callbacks receive
> `&Data` from foreign threads.
> 4. Update the safety comments in FFI callbacks that call `get_group_data`
> to cite these bounds as justification for sharing the returned
> references with the callback thread.
> 5. Remove redundant `Child: 'static` bounds from `GroupOperationsVTable`
> and `new_with_child_ctor`.
>
> [...]
Applied, thanks!
[1/1] rust: configfs: require thread-safe callback data
commit: ec27f3b700010d2ebae1cde2df0246197689d159
Best regards,
--
Andreas Hindborg <a.hindborg@xxxxxxxxxx>