7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andreas Hindborg commit e502b667ee70a7fa2a578e7722672ecd4fe0eb81 upstream. The `Send` implementation for `GenDisk` was conditioned on `T: Send`. This constrains the wrong type. `T` is the `Operations` implementation, which is typically a zero-sized marker type that carries no data, so `T: Send` says nothing about whether the data a `GenDisk` actually owns can be moved to another thread. A `GenDisk` owns the queue data `T::QueueData` (stored as the `gendisk`'s `queuedata` and dropped when the `GenDisk` is dropped) and an `Arc>`. These are the values transferred when a `GenDisk` is sent across a thread boundary, so the `Send` bound must constrain exactly them. Bound `T::QueueData: Send` and `Arc>: Send` instead. Fixes: 3253aba3408a ("rust: block: introduce `kernel::block::mq` module") Cc: stable@vger.kernel.org Reported-by: Priya Bala Govindasamy , Dylan Zueck , Yuan Tan Closes: https://lore.kernel.org/all/cover.1780633578.git.ytan089@ucr.edu Signed-off-by: Yuan Tan Link: https://msgid.link/20260709100100.604252-1-yuantan098@gmail.com [ Andreas: Fix tags to make checkpatch happy. Change summary line. ] Signed-off-by: Andreas Hindborg Link: https://patch.msgid.link/20260929-rust-block-for-v7-4-rc1-b4-v1-4-642a4c1aebd7@kernel.org Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- rust/kernel/block/mq/gen_disk.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/rust/kernel/block/mq/gen_disk.rs +++ b/rust/kernel/block/mq/gen_disk.rs @@ -212,8 +212,14 @@ pub struct GenDisk { } // SAFETY: `GenDisk` is an owned pointer to a `struct gendisk` and an `Arc` to a -// `TagSet` It is safe to send this to other threads as long as T is Send. -unsafe impl Send for GenDisk {} +// `TagSet`. It is safe to send this to other threads as long as these two are `Send`. +unsafe impl Send for GenDisk +where + T: Operations, + T::QueueData: Send, + Arc>: Send, +{ +} impl Drop for GenDisk { fn drop(&mut self) {