Thread (18 messages) 18 messages, 5 authors, 2026-01-13

Re: [PATCH v3 1/4] mm: declare VMA flags by bit

From: Chris Mason <hidden>
Date: 2026-01-13 18:52:31
Also in: linux-fsdevel, linux-mm, lkml

On Tue, 25 Nov 2025 10:00:59 +0000 Lorenzo Stoakes [off-list ref] 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:
quoted hunk ↗ jump to hunk
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;
[ ... ]

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help