Skip to content

Commit b0a93fa

Browse files
rpptsmb49
authored andcommitted
nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff
BugLink: https://bugs.launchpad.net/bugs/1926489 commit a3a8833 upstream. 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/20210330175126.26500-1-rppt@kernel.org Fixes: cb9f753 ("mm: fix races between swapoff and flush dcache") Signed-off-by: Mike Rapoport <rppt@linux.ibm.com> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Greentime Hu <green.hu@gmail.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Nick Hu <nickhu@andestech.com> Cc: Vincent Chen <deanbo422@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 91386d8 commit b0a93fa

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
@@ -239,7 +239,7 @@ void flush_dcache_page(struct page *page)
239239
{
240240
struct address_space *mapping;
241241

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

0 commit comments

Comments
 (0)