linux/rust/kernel
Andreas Hindborg fd764e74e5 rust: block: fix wrong usage of lockdep API
When allocating `struct gendisk`, `GenDiskBuilder` is using a dynamic
lock class key without registering the key. This is an incorrect use of
the API, which causes a `WARN` trace.

Fix the issue by using a static lock class key, which is more appropriate
for the situation anyway.

Fixes: 3253aba340 ("rust: block: introduce `kernel::block::mq` module")
Reported-by: Behme Dirk (XC-CP/ESB5) <Dirk.Behme@de.bosch.com>
Closes: https://rust-for-linux.zulipchat.com/#narrow/stream/x/topic/x/near/457090036
Signed-off-by: Andreas Hindborg <a.hindborg@samsung.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Dirk Behme <dirk.behme@de.bosch.com>
Link: https://lore.kernel.org/r/20240815074519.2684107-3-nmi@metaspace.dk
[ Applied `rustfmt`, reworded slightly and made Zulip link
  a permalink. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2024-08-21 13:28:13 +02:00
..
alloc Merge branch 'slab/for-6.11/buckets' into slab/for-next 2024-07-15 10:44:16 +02:00
block rust: block: fix wrong usage of lockdep API 2024-08-21 13:28:13 +02:00
init rust: init: change the generated name of guard variables 2024-05-05 18:05:00 +02:00
net Rust changes for v6.10 2024-05-13 15:13:54 -07:00
sync rust: kernel: remove redundant imports 2024-05-05 19:22:25 +02:00
alloc.rs rust: add abstraction for struct page 2024-07-08 23:44:01 +02:00
block.rs rust: block: introduce kernel::block::mq module 2024-06-14 07:45:04 -06:00
build_assert.rs rust: upgrade to Rust 1.68.2 2023-05-31 17:35:03 +02:00
device.rs device: rust: improve safety comments 2024-06-20 16:14:58 +02:00
error.rs rust: block: introduce kernel::block::mq module 2024-06-14 07:45:04 -06:00
firmware.rs rust: firmware: fix invalid rustdoc link 2024-07-31 13:24:29 +02:00
init.rs rust: init: simplify from map_err to inspect_err 2024-07-10 10:28:51 +02:00
ioctl.rs rust: kernel: mark code fragments in docs with backticks 2024-02-18 21:22:27 +01:00
kunit.rs rust: support srctree-relative links 2023-12-21 20:54:17 +01:00
lib.rs Rust changes for v6.11 2024-07-27 13:44:54 -07:00
net.rs rust: core abstractions for network PHY drivers 2023-12-15 09:35:50 +00:00
page.rs rust: add abstraction for struct page 2024-07-08 23:44:01 +02:00
prelude.rs rust: alloc: introduce the BoxExt trait 2024-04-16 22:47:20 +02:00
print.rs rust: kernel: remove redundant imports 2024-05-05 19:22:25 +02:00
static_assert.rs rust: static_assert: add static_assert! macro 2022-12-04 01:59:16 +01:00
std_vendor.rs rust: update dbg!() to format column number 2024-05-05 18:09:04 +02:00
str.rs rust: kernel: remove redundant imports 2024-05-05 19:22:25 +02:00
sync.rs rust: sync: implement Default for LockClassKey 2024-05-05 19:22:25 +02:00
task.rs rust: kernel: remove redundant imports 2024-05-05 19:22:25 +02:00
time.rs rust: time: doc: Add missing C header links 2024-05-01 00:04:47 +02:00
types.rs rust: uaccess: add typed accessors for userspace pointers 2024-07-08 23:44:01 +02:00
uaccess.rs rust: uaccess: add typed accessors for userspace pointers 2024-07-08 23:44:01 +02:00
workqueue.rs rust: kernel: make impl_has_work compatible with more generics 2024-07-08 22:39:39 +02:00