Re: [PATCH v12 2/6] ww_mutex: add ww_class field unconditionally
From: Gary Guo
Date: Mon Oct 12 2026 - 07:43:59 EST
On Mon Oct 12, 2026 at 11:26 AM BST, Onur Özkan wrote:
> Removes DEBUG_WW_MUTEXES guard around the ww_class field
> in struct ww_mutex and struct ww_acquire_ctx to always
> initialize it.
>
> Keeping the class pointer available unconditionally allows
> Rust abstractions to keep from_raw() simple on Mutex and
> AcquireCtx and validate Mutex and AcquireCtx class pairing
> in much simpler way.
Is a mismatch a memory safety issue or just a bug?
Best,
Gary
>
> Link: https://lore.kernel.org/all/ECC0425A-8B18-4626-8EA8-2F843C45E0A1@xxxxxxxxxxxxx/
> Reviewed-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
> Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>
> Signed-off-by: Onur Özkan <work@xxxxxxxxxxxxx>