Skip to content

Commit a3a8833

Browse files
rppttorvalds
authored andcommitted
nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff
Commit cb9f753 ("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: https://lkml.kernel.org/r/[email protected] Fixes: cb9f753 ("mm: fix races between swapoff and flush dcache") Signed-off-by: Mike Rapoport <[email protected]> Reviewed-by: Matthew Wilcox (Oracle) <[email protected]> Acked-by: Greentime Hu <[email protected]> Cc: Huang Ying <[email protected]> Cc: Nick Hu <[email protected]> Cc: Vincent Chen <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent d3378e8 commit a3a8833

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/nds32/mm/cacheflush.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ void flush_dcache_page(struct page *page)
238238
{
239239
struct address_space *mapping;
240240

241-
mapping = page_mapping(page);
241+
mapping = page_mapping_file(page);
242242
if (mapping && !mapping_mapped(mapping))
243243
set_bit(PG_dcache_dirty, &page->flags);
244244
else {

0 commit comments

Comments
 (0)