Re: [PATCH v3 1/4] mm: declare VMA flags by bit
From: Lorenzo Stoakes
Date: Tue Jan 13 2026 - 14:12:31 EST
On Tue, Jan 13, 2026 at 10:51:37AM -0800, Chris Mason wrote:
> On Tue, 25 Nov 2025 10:00:59 +0000 Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx> wrote:
>
> [ ... ]
> >
> > Finally, we update the rust binding helper as now it cannot auto-detect the
> > flags at all.
> >
>
> I did a run of all the MM commits from 6.18 to today's linus, and this one
> had a copy/paste error. I'd normally just send a patch for this, but in
> terms of showing the review output:
>
> > diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> > index 2e43c66635a2c..4c327db01ca03 100644
> > --- a/rust/bindings/bindings_helper.h
> > +++ b/rust/bindings/bindings_helper.h
> > @@ -108,7 +108,32 @@ const xa_mark_t RUST_CONST_HELPER_XA_PRESENT = XA_PRESENT;
>
> [ ... ]
>
> > +const vm_flags_t RUST_CONST_HELPER_VM_MAYREAD = VM_MAYREAD;
> > +const vm_flags_t RUST_CONST_HELPER_VM_MAYWRITE = VM_MAYWRITE;
> > +const vm_flags_t RUST_CONST_HELPER_VM_MAYEXEC = VM_MAYEXEC;
> > +const vm_flags_t RUST_CONST_HELPER_VM_MAYSHARE = VM_MAYEXEC;
> ^^^^^^^^^^
>
> Should this be VM_MAYSHARE instead of VM_MAYEXEC? This appears to be a
> copy-paste error that would cause Rust code using VmFlags::MAYSHARE to
> get bit 6 (VM_MAYEXEC) instead of bit 7 (VM_MAYSHARE).
>
> The pattern of the preceding lines shows each constant should reference
> its matching flag:
>
> RUST_CONST_HELPER_VM_MAYREAD = VM_MAYREAD
> RUST_CONST_HELPER_VM_MAYWRITE = VM_MAYWRITE
> RUST_CONST_HELPER_VM_MAYEXEC = VM_MAYEXEC
> RUST_CONST_HELPER_VM_MAYSHARE = VM_MAYSHARE <- expected
>
> > +const vm_flags_t RUST_CONST_HELPER_VM_PFNMAP = VM_PFNMAP;
>
> [ ... ]
>
>
Oopsies!
I can send a patch unless you were planning to!
Cheers, Lorenzo