Re: [PATCH v6 07/39] mm: assert mmap lock held, use new flags API in vm_insert_page[s]

From: Gregory Price (Meta)

Date: Tue Oct 20 2026 - 17:49:08 EST


On 2026-10-13 16:04 +0100, Lorenzo Stoakes (ARM) wrote:
> The existing logic asserts that an mmap write lock is held, bizarrely, by
> asserting that an mmap_read_trylock() fails (which is not the same thing).
>
> Assert the mmap write lock here and switch to using the new VMA flags API
> while here.
>
> Note that the vma_start_write() is explicitly broken out from
> vm_flags_set() here in order to use vma_set_flags() safely.
>
> Signed-off-by: Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx>

Reviewed-by: Gregory Price (Meta) <gourry@xxxxxxxxxx>

--
Gregory Price (Meta) <gourry@xxxxxxxxxx>