Commit 5f84b41b authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Liu Shixin
Browse files

mm: use mapping_evict_folio() in truncate_error_page()

mainline inclusion
from mainline-v6.8-rc1
commit 19369d866a8b89788cdc9b10c7b8c9b2777f806b
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAO6NS

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=19369d866a8b89788cdc9b10c7b8c9b2777f806b

--------------------------------

We already have the folio and the mapping, so replace the call to
invalidate_inode_page() with mapping_evict_folio().

Link: https://lkml.kernel.org/r/20231108182809.602073-4-willy@infradead.org


Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLiu Shixin <liushixin2@huawei.com>
parent e8b3047f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -943,10 +943,10 @@ static int delete_from_lru_cache(struct page *p)
static int truncate_error_page(struct page *p, unsigned long pfn,
				struct address_space *mapping)
{
	struct folio *folio = page_folio(p);
	int ret = MF_FAILED;

	if (mapping->a_ops->error_remove_page) {
		struct folio *folio = page_folio(p);
		int err = mapping->a_ops->error_remove_page(mapping, p);

		if (err != 0)
@@ -960,7 +960,7 @@ static int truncate_error_page(struct page *p, unsigned long pfn,
		 * If the file system doesn't support it just invalidate
		 * This fails on dirty or anything with private pages
		 */
		if (invalidate_inode_page(p))
		if (mapping_evict_folio(mapping, folio))
			ret = MF_RECOVERED;
		else
			pr_info("%#lx: Failed to invalidate\n",	pfn);