lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zbvuz5iym2MhNzPQ@boqun-archlinux>
Date: Thu, 1 Feb 2024 11:19:43 -0800
From: Boqun Feng <boqun.feng@...il.com>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Tejun Heo <tj@...nel.org>, Wedson Almeida Filho <wedsonaf@...il.com>,
	Alex Gaynor <alex.gaynor@...il.com>, Gary Guo <gary@...yguo.net>,
	Björn Roy Baron <bjorn3_gh@...tonmail.com>,
	Benno Lossin <benno.lossin@...ton.me>,
	Andreas Hindborg <a.hindborg@...sung.com>,
	Alice Ryhl <aliceryhl@...gle.com>, rust-for-linux@...r.kernel.org,
	linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH] workqueue: rust: sync with `WORK_CPU_UNBOUND` change

On Thu, Feb 01, 2024 at 08:06:20PM +0100, Miguel Ojeda wrote:
> Commit e563d0a7cdc1 ("workqueue: Break up enum definitions and give
> names to the types") gives a name to the `enum` where `WORK_CPU_UNBOUND`
> was defined, so `bindgen` changes its output from e.g.:
> 
>     pub type _bindgen_ty_10 = core::ffi::c_uint;
>     pub const WORK_CPU_UNBOUND: _bindgen_ty_10 = 64;
> 
> to e.g.:
> 
>     pub type wq_misc_consts = core::ffi::c_uint;
>     pub const wq_misc_consts_WORK_CPU_UNBOUND: wq_misc_consts = 64;
> 
> Thus update Rust's side to match the change (which requires a slight
> reformat of the code), fixing the build error.
> 
> Closes: https://lore.kernel.org/rust-for-linux/CANiq72=9PZ89bCAVX0ZV4cqrYSLoZWyn-d_K4KpBMHjwUMdC3A@mail.gmail.com/
> Fixes: e563d0a7cdc1 ("workqueue: Break up enum definitions and give names to the types")
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>

Reviewed-by: Boqun Feng <boqun.feng@...il.com>

Regards,
Boqun

> ---
> Tejun: here is the formal patch as you requested. Please feel free to
> either take it or to rebase to fix the old commit. Thanks!
> 
>  rust/kernel/workqueue.rs | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/rust/kernel/workqueue.rs b/rust/kernel/workqueue.rs
> index 498397877376..d00231e18007 100644
> --- a/rust/kernel/workqueue.rs
> +++ b/rust/kernel/workqueue.rs
> @@ -199,7 +199,11 @@ pub fn enqueue<W, const ID: u64>(&self, w: W) -> W::EnqueueOutput
>          // stay valid until we call the function pointer in the `work_struct`, so the access is ok.
>          unsafe {
>              w.__enqueue(move |work_ptr| {
> -                bindings::queue_work_on(bindings::WORK_CPU_UNBOUND as _, queue_ptr, work_ptr)
> +                bindings::queue_work_on(
> +                    bindings::wq_misc_consts_WORK_CPU_UNBOUND as _,
> +                    queue_ptr,
> +                    work_ptr,
> +                )
>              })
>          }
>      }
> 
> base-commit: 15930da42f8981dc42c19038042947b475b19f47
> --
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ