Re: [PATCH] rust: block: implement `Send` and `Sync` for `TagSet`

From: Alice Ryhl

Date: Wed Sep 30 2026 - 16:07:54 EST


On Wed, Sep 30, 2026 at 9:44 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>
> `TagSet` never implemented `Send` or `Sync`. This did not matter until
> commit "rust: block: fix `Send` bound for `GenDisk`" made `GenDisk: Send`
> depend on `Arc<TagSet<T>>: Send`, which in turn requires `TagSet<T>: Send +
> Sync`. With that bound unsatisfiable, `GenDisk` is never `Send`, and the
> rnull driver fails to build once configfs requires `GroupOperations::Child:
> Send`.
>
> `TagSet` owns no data typed by `T`. It only wraps the C `struct
> blk_mq_tag_set`, which can be dropped from any thread by calling
> `blk_mq_free_tag_set`. Thus, implement `Send` and `Sync` for `TagSet`
> unconditionally.
>
> Reported-by: Thorsten Leemhuis <linux@xxxxxxxxxxxxx>
> Closes: https://lore.kernel.org/r/d1381ed8-eab8-4fd7-8b15-1e94876d7099@xxxxxxxxxxxxx
> Suggested-by: Gary Guo <gary@xxxxxxxxxxx>
> Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>

Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>