linux/arch/nds32/mm
Mike Rapoport 4fabcf2294 nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff
commit a3a8833dff upstream.

Commit cb9f753a37 ("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: cb9f753a37 ("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>
2021-04-14 08:41:58 +02:00
..
alignment.c uaccess: add force_uaccess_{begin,end} helpers 2020-08-12 10:57:59 -07:00
cacheflush.c nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff 2021-04-14 08:41:58 +02:00
extable.c nds32: MMU fault handling and page table management 2018-02-22 10:44:31 +08:00
fault.c mm/nds32: use general page fault accounting 2020-08-12 10:58:03 -07:00
highmem.c arch/kmap: define kmap_atomic_prot() for all arch's 2020-06-04 19:06:22 -07:00
init.c mm: pgtable: add shortcuts for accessing kernel PMD and PTE 2020-06-09 09:39:13 -07:00
Makefile nds32: use generic ioremap 2019-11-12 11:37:58 +01:00
mm-nds32.c asm-generic: pgalloc: provide generic pgd_free() 2020-08-07 11:33:26 -07:00
mmap.c nds32: MMU fault handling and page table management 2018-02-22 10:44:31 +08:00
proc.c mm: pgtable: add shortcuts for accessing kernel PMD and PTE 2020-06-09 09:39:13 -07:00
tlb.c nds32: Cache and TLB routines 2018-02-22 10:44:32 +08:00