Skip to content

block: rust: fix Send bound for GenDisk#8

Open
blktests-ci-block-trial[bot] wants to merge 1 commit into
master_basefrom
series/277=>master
Open

block: rust: fix Send bound for GenDisk#8
blktests-ci-block-trial[bot] wants to merge 1 commit into
master_basefrom
series/277=>master

Conversation

@blktests-ci-block-trial

Copy link
Copy Markdown

Pull request for series with
subject: block: rust: fix Send bound for GenDisk
version: 1
url: http://redsun45:8000/project/linux-block/list/?series=277

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: 3253aba ("rust: block: introduce `kernel::block::mq` module")
Links: https://lore.kernel.org/all/cover.1780633578.git.ytan089@ucr.edu
Cc: stable@vger.kernel.org
Reported-by: Priya Bala Govindasamy <pgovind2@uci.edu>
Reported-by: Dylan Zueck <dzueck@uci.edu>
Reported-by: Yuan Tan <ytan089@ucr.edu>
Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Signed-off-by: Yuan Tan <ytan089@ucr.edu>
@blktests-ci-block-trial

Copy link
Copy Markdown
Author

Upstream branch: a635d67
series: http://redsun45:8000/project/linux-block/list/?series=277
version: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants