Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: assert_pte_locked() use pte_offset_map_ro_nolock()

In assert_pte_locked(), we just get the ptl and assert if it was already
held, so convert it to using pte_offset_map_ro_nolock().

Link: https://lkml.kernel.org/r/42559e042eb6fc3129a40f710d671712030646b4.1727332572.git.zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Muchun Song <muchun.song@linux.dev>
Cc: Hugh Dickins <hughd@google.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Peter Xu <peterx@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Qi Zheng and committed by
Andrew Morton
7aefa598 66efef9b

+1 -1
+1 -1
arch/powerpc/mm/pgtable.c
··· 398 398 */ 399 399 if (pmd_none(*pmd)) 400 400 return; 401 - pte = pte_offset_map_nolock(mm, pmd, addr, &ptl); 401 + pte = pte_offset_map_ro_nolock(mm, pmd, addr, &ptl); 402 402 BUG_ON(!pte); 403 403 assert_spin_locked(ptl); 404 404 pte_unmap(pte);