Files
linux/rust/kernel/block
Andreas Hindborg 06dad60393 rust: block: implement Send and Sync for TagSet
`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 <[email protected]>
Closes: https://lore.kernel.org/r/[email protected]
Suggested-by: Gary Guo <[email protected]>
Signed-off-by: Andreas Hindborg <[email protected]>
Tested-by: Thorsten Leemhuis <[email protected]>
Reviewed-by: Alice Ryhl <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
2026-10-01 07:53:55 -06:00
..