Re: [PATCH v2 01/83] block: rust: fix `Send` bound for `GenDisk`

From: Andreas Hindborg

Date: Wed Jun 10 2026 - 05:09:41 EST


Yuan Tan <ytan089@xxxxxxx> writes:

> On Tue, Jun 9, 2026 at 12:13 PM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>>
>> The `Send` implementation for `GenDisk<T>` 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<T>` owns the queue data `T::QueueData` (stored as the
>> `gendisk`'s `queuedata` and dropped when the `GenDisk` is dropped) and an
>> `Arc<TagSet<T>>`. 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<TagSet<T>>: Send` instead.
>>
>> Fixes: 3253aba3408a ("rust: block: introduce `kernel::block::mq` module")
>> Suggested-by: Yuan Tan <ytan089@xxxxxxx>
>> Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
>> ---
>>
>> Please take patch from Yuan instead of this one, if they send a fixed
>> version [1].
>>
>> [1] https://lore.kernel.org/r/8839ddc5ff54bf454d508cde91d27d00fc3e2dd8.1780633578.git.ytan089@xxxxxxx
>
> My last email mistakenly enabled html. So I am here to resend it. Hope
> it doesn't disturb anyone.
>
> Sorry, I've been busy with other things and haven't had the chance to
> send the fixed version.
>
> Thank you very much for reviewing the patch and for preparing the v2 version.
>
> Could you please add the following when applying this patch?
> Reported-by: Priya Bala Govindasamy <pgovind2@xxxxxxx>
> Reported-by: Dylan Zueck <dzueck@xxxxxxx>
>
> I didn't discover this issue myself. I just helped write the patch and
> I don't want them to lose their credit for it.
>
> Please let me know if you would prefer that I send a v3 instead.

I would absolutely encourage you to send a v3 so we can pick that one.

Your emails are not arriving in my inbox though. I only see this one on
the list. Please check your setup for outgoing email.

Best regards,
Andreas Hindborg