path: root/arch/nds32
diff options
authorMike Rapoport <>2021-04-09 13:27:23 -0700
committerLinus Torvalds <>2021-04-09 14:54:23 -0700
commita3a8833dffb7e7329c2586b8bfc531adb503f123 (patch)
tree7fadf4a4abab241df784c017e8b9bb7efc2064c7 /arch/nds32
parentd3378e86d1822b6d0bebfbc18a8348691c05dfa0 (diff)
nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff
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(). Link: Fixes: cb9f753a3731 ("mm: fix races between swapoff and flush dcache") Signed-off-by: Mike Rapoport <> Reviewed-by: Matthew Wilcox (Oracle) <> Acked-by: Greentime Hu <> Cc: Huang Ying <> Cc: Nick Hu <> Cc: Vincent Chen <> Cc: <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'arch/nds32')
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/nds32/mm/cacheflush.c b/arch/nds32/mm/cacheflush.c
index 6eb98a7ad27d..ad5344ef5d33 100644
--- a/arch/nds32/mm/cacheflush.c
+++ b/arch/nds32/mm/cacheflush.c
@@ -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 {