Re: [GIT PULL PATCH 0/9] Rust changes for v7.4-rc1
From: Andreas Hindborg
Date: Wed Sep 30 2026 - 15:52:36 EST
"Gary Guo" <gary@xxxxxxxxxxx> writes:
> On Wed Sep 30, 2026 at 4:06 PM BST, Thorsten Leemhuis wrote:
>> On 9/29/26 13:47, Jens Axboe wrote:
>>> On Tue, 29 Sep 2026 11:33:58 +0200, Andreas Hindborg wrote:
>>>> I have a number of Rust block layer patches I would ask you to pick for
>>>> v7.4. I have collected them into a patch series as well as a pull request
>>>> so you can use whatever is easier.
>>>>
>>>> The changes cover
>>>>
>>>> - Style and formatting changes.
>>>> - Documentation fixes.
>>>> - Fixes for missing trait bounds that can cause API unsoundness.
>>>> - A change to set the owner of the file operations vtable in `GenDisk`.
>>>> - Two bug fixes for the rnull driver.
>>>>
>>>> [...]
>>>
>>> Applied, thanks!
>>> [...]
>>
>> This series showed up in next today and broke the build for me on
>> various Fedora releases for aarch64 and x86_64; reverting this series
>> fixed that from a quick build test limited to drivers/block/rnull/
>>
>> The full error msg is quote long, find the top of it below. Full log:
>> https://download.copr.fedorainfracloud.org/results/@kernel-vanilla/next/fedora-rawhide-aarch64/11055137-next-next-all/builder-live.log.gz
>
> The `Child: Send` bound is introduced in configfs:
> https://lore.kernel.org/all/tencent_05937A22D2DA2BAE808EF19E491AA109BC09@xxxxxx/.
> So this is more or less a semantic conflict.
I did not consider the interactions of the two trees together. Good
thing we have linux-next.
> However, the fundamental issue is that TagSet never implements Send/Sync, which
> means that "rust: block: fix `Send` bound for `GenDisk`" will unconditionally
> strip away the Send implementation, which is problematic.
>
> Something like this should fix the issue:
>
> unsafe impl<T: Operations<QueueData: Send>> Send for TagSet<T> {}
> unsafe impl<T: Operations<QueueData: Send>> Sync for TagSet<T> {}
>
> That said, I am not sure why the GenDisk need to carry `Arc<TagSet<T>>: Send`
> bound in the first place. Removing it should also fix the issue.
`GenDisk<T>` has a field of type `Arc<TagSet<T>>`, so for `GenDisk` to be
send, so must `Arc<TagSet<T>>`. That `Arc` may be dropped with the
`GenDisk` if it is the last reference.
> Also, the `QueueData: Send` bound should be part of the `Operations` trait and
> not carried around everywhere.
`QueueData` is not involved here. An unconditional implementation is
fine. I submitted a patch here [1], hopefully Jens can pick it soon so
next can be unbroken tomorrow.
Best regards,
Andreas Hindborg
[1] https://lore.kernel.org/r/20260930-tag-set-send-sync-v1-1-51acdb36f4bb@xxxxxxxxxx