rust: block: require Sync for Operations::QueueData#941
rust: block: require Sync for Operations::QueueData#941blktests-ci[bot] wants to merge 1 commit into
Sync for Operations::QueueData#941Conversation
|
Upstream branch: 979c294 |
|
Upstream branch: 979c294 |
8467656 to
54ecde0
Compare
|
Upstream branch: 979c294 |
54ecde0 to
aa05745
Compare
a7bb5c5 to
5e41a3b
Compare
|
Upstream branch: acb7500 |
aa05745 to
d255c44
Compare
5e41a3b to
c3a084b
Compare
|
Upstream branch: 9716c08 |
d255c44 to
a3c7d60
Compare
c3a084b to
5f78e5d
Compare
|
Upstream branch: 2a2974b |
a3c7d60 to
6743e64
Compare
5f78e5d to
e48f9db
Compare
|
Upstream branch: 062871f |
6743e64 to
bc3d116
Compare
199644a to
e6d9eb8
Compare
|
Upstream branch: 66affa3 |
bc3d116 to
538b704
Compare
e6d9eb8 to
7d8604f
Compare
|
Upstream branch: bade58e |
538b704 to
1542f34
Compare
7d8604f to
4cc45a3
Compare
|
Upstream branch: 4edcdef |
1542f34 to
eae95a5
Compare
4cc45a3 to
90ffd56
Compare
|
Upstream branch: dc59e4f |
The queue data installed in a `GenDisk` is stored in the request queue and handed back to the driver as a shared borrow through the `queue_rq` and `commit_rqs` callbacks. Both callbacks obtain that borrow via `ForeignOwnable::borrow` and may execute concurrently on several CPUs, since the block layer runs one hardware queue per CPU. That means a shared reference to the same queue data can be live on multiple threads at once, which is only sound when the referent is `Sync`. The initial `GenDisk` private data support omitted this bound, so a driver could install a non-`Sync` type as queue data and then access it concurrently from multiple CPUs without synchronization. Add a `Sync` bound to the `QueueData` associated type to rule that out. Fixes: 90d952f ("rust: block: add `GenDisk` private data support") Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Gary Guo <gary@garyguo.net>
eae95a5 to
bcf22b2
Compare
Pull request for series with
subject: rust: block: require
SyncforOperations::QueueDataversion: 1
url: https://patchwork.kernel.org/project/linux-block/list/?series=1107573