Re: [PATCH] mm: use proper PTE accessor in move_ptes()
From: Usama Anjum
Date: Thu Jul 30 2026 - 07:54:49 EST
On 20/07/2026 3:16 pm, Alexander Gordeev wrote:
> Follow the pattern established by commit c33c794828f2
> ("mm: ptep_get() conversion") and use the proper PTE
> accessor instead of a direct pointer dereference.
>
> Fixes: b36b701bbcd9 ("mm: expose abnormal new_pte during move_ptes")
> Signed-off-by: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>
> ---
> mm/mremap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/mremap.c b/mm/mremap.c
> index 0dfe3de39ccc..e99b19a9850b 100644
> --- a/mm/mremap.c
> +++ b/mm/mremap.c
> @@ -264,7 +264,7 @@ static int move_ptes(struct pagetable_move_control *pmc,
>
> for (; old_addr < old_end; old_ptep += nr_ptes, old_addr += nr_ptes * PAGE_SIZE,
> new_ptep += nr_ptes, new_addr += nr_ptes * PAGE_SIZE) {
> - VM_WARN_ON_ONCE(!pte_none(*new_ptep));
> + VM_WARN_ON_ONCE(!pte_none(ptep_get(new_ptep)));
I'd the same patch in my RFC branch. Hence:
Reviewed-by: Muhammad Usama Anjum <usama.anjum@xxxxxxx>
>
> nr_ptes = 1;
> max_nr_ptes = (old_end - old_addr) >> PAGE_SHIFT;