]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/damon/vaddr: fix missing pte_unmap_unlock in damos_va_migrate_pmd_entry()
authorAkinobu Mita <akinobu.mita@gmail.com>
Tue, 9 Dec 2025 15:10:34 +0000 (00:10 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 23 Dec 2025 19:23:13 +0000 (11:23 -0800)
If the PTE page table lock is acquired by pte_offset_map_lock(), the lock
must be released via pte_unmap_unlock().

However, in damos_va_migrate_pmd_entry(), if damos_va_filter_out() returns
true, it immediately returns without releasing the lock.

This fixes the issue by not stopping page table traversal when
damos_va_filter_out() returns true and ensuring that the lock is released.

Link: https://lkml.kernel.org/r/20251209151034.77221-1-akinobu.mita@gmail.com
Fixes: 09efc56a3b1c ("mm/damon/vaddr: consistently use only pmd_entry for damos_migrate")
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/vaddr.c

index 2750c88e722528fac3e6a256fda124557b62bc03..23ed738a0bd6f91f1387d4ee4784a156f64dc311 100644 (file)
@@ -743,7 +743,7 @@ huge_out:
                if (!folio)
                        continue;
                if (damos_va_filter_out(s, folio, walk->vma, addr, pte, NULL))
-                       return 0;
+                       continue;
                damos_va_migrate_dests_add(folio, walk->vma, addr, dests,
                                migration_lists);
                nr = folio_nr_pages(folio);