Skip to contentSkip to conversation

nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff

PATCH In review Mike Rapoport 3 participants 4 messages Mar 30, 2021 – Mar 31, 2021 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff

From: Mike Rapoport <[email protected]>

Commit cb9f753a3731 ("mm: fix races between swapoff and flush dcache") updated flush_dcache_page implementations on several architectures to use page_mapping_file() in order to avoid races between page_mapping() and swapoff().

This update missed arch/nds32 and there is a possibility of a race there.

Replace page_mapping() with page_mapping_file() in nds32 implementation of flush_dcache_page().

Fixes cb9f753a3731 ("mm: fix races between swapoff and flush dcache")
---
 arch/nds32/mm/cacheflush.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nds32/mm/cacheflush.c +1 -1
index 6eb98a7ad27d..ad5344ef5d33 100644
@@ -238,7 +238,7 @@ void flush_dcache_page(struct page *page)
 {
 	struct address_space *mapping;
 
-	mapping = page_mapping(page);
+	mapping = page_mapping_file(page);
 	if (mapping && !mapping_mapped(mapping))
 		set_bit(PG_dcache_dirty, &page->flags);
 	else {
Signature · 1 line
2.28.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Mike Rapoport

From: Mike Rapoport <[email protected]>

Commit cb9f753a3731 ("mm: fix races between swapoff and flush dcache") updated flush_dcache_page implementations on several architectures to use page_mapping_file() in order to avoid races between page_mapping() and swapoff().

Quoted 7 lines

This update missed arch/nds32 and there is a possibility of a race there.

Replace page_mapping() with page_mapping_file() in nds32 implementation of flush_dcache_page().

Fixes cb9f753a3731 ("mm: fix races between swapoff and flush dcache")
Acked-by
#2 lore raw

Matthew Wilcox <[email protected]> 於 2021年3月31日 週三 上午2:14寫道:

Quoted 11 lines · Mike Rapoport
Quoted 9 lines

From: Mike Rapoport <[email protected]>

Commit cb9f753a3731 ("mm: fix races between swapoff and flush dcache") updated flush_dcache_page implementations on several architectures to use page_mapping_file() in order to avoid races between page_mapping() and swapoff().

This update missed arch/nds32 and there is a possibility of a race there.

Quoted 7 lines
Quoted 5 lines

Replace page_mapping() with page_mapping_file() in nds32 implementation of flush_dcache_page().

Fixes cb9f753a3731 ("mm: fix races between swapoff and flush dcache")
Acked-by
#3 lore raw

Greentime Hu <[email protected]> 於 2021年3月31日 週三 下午3:30寫道:

Quoted 16 lines

Matthew Wilcox <[email protected]> 於 2021年3月31日 週三 上午2:14寫道:

Quoted 14 lines · Mike Rapoport
Quoted 12 lines

From: Mike Rapoport <[email protected]>

Commit cb9f753a3731 ("mm: fix races between swapoff and flush dcache") updated flush_dcache_page implementations on several architectures to use page_mapping_file() in order to avoid races between page_mapping() and swapoff().

This update missed arch/nds32 and there is a possibility of a race there.

Replace page_mapping() with page_mapping_file() in nds32 implementation of flush_dcache_page().

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Fixes cb9f753a3731 ("mm: fix races between swapoff and flush dcache")

Typo.