Re: [PATCH v3 2/2] rust: page: Extend support to existing struct page mappings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21/11/2024 22:17, Jann Horn wrote:

Does Rust also prevent safe code from invoking inc_ref() on the
returned Page reference? Normally, the AlwaysRefCounted trait means
that safe code can create an owned reference from a shared reference,
right?

While it is possible for someone to *manually* convert the Page reference returned in page_slice_to_page() to a refcounted Page (one could wrap it in an ARef). However, by design, page_slice_to_page() explicitly returns just an ordinary Page reference. We could add an invariant in page_slice_to_page() to warn against such usage just in case.

Anyway seems like the consensus from the other thread is to avoid refcounting the rust Page abstraction. If we go with that, then that moots this issue.

Regards,
Abdiel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux