]> git.baikalelectronics.ru Git - kernel.git/commit
nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff
authorMike Rapoport <rppt@linux.ibm.com>
Fri, 9 Apr 2021 20:27:23 +0000 (13:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 9 Apr 2021 21:54:23 +0000 (14:54 -0700)
commit27e1a0ef16b3e05af745a8a2071f63477e9f969e
tree7fadf4a4abab241df784c017e8b9bb7efc2064c7
parent88629ba9446fcaacb8c7eea390f8db5a5fcb825e
nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff

Commit a7b7f0d37f50 ("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: a7b7f0d37f50 ("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>
arch/nds32/mm/cacheflush.c