[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210412084014.457353921@linuxfoundation.org>
Date: Mon, 12 Apr 2021 10:38:58 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Mike Rapoport <rppt@...ux.ibm.com>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Greentime Hu <green.hu@...il.com>,
Huang Ying <ying.huang@...el.com>,
Nick Hu <nickhu@...estech.com>,
Vincent Chen <deanbo422@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: [PATCH 5.10 024/188] nds32: flush_dcache_page: use page_mapping_file to avoid races with swapoff
From: Mike Rapoport <rppt@...ux.ibm.com>
commit a3a8833dffb7e7329c2586b8bfc531adb503f123 upstream.
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: https://lkml.kernel.org/r/20210330175126.26500-1-rppt@kernel.org
Fixes: cb9f753a3731 ("mm: fix races between swapoff and flush dcache")
Signed-off-by: Mike Rapoport <rppt@...ux.ibm.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@...radead.org>
Acked-by: Greentime Hu <green.hu@...il.com>
Cc: Huang Ying <ying.huang@...el.com>
Cc: Nick Hu <nickhu@...estech.com>
Cc: Vincent Chen <deanbo422@...il.com>
Cc: <stable@...r.kernel.org>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
arch/nds32/mm/cacheflush.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- 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 {
Powered by blists - more mailing lists