Skip to content

Commit

Permalink
memory-failure: convert truncate_error_page() to use folio
Browse files Browse the repository at this point in the history
[ Upstream commit ac5efa7 ]

Replace try_to_release_page() with filemap_release_folio().  This change
is in preparation for the removal of the try_to_release_page() wrapper.

Link: https://lkml.kernel.org/r/20221118073055.55694-4-vishal.moola@gmail.com
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Acked-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 1898efc ("block: update the stable_writes flag in bdev_add")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
VMoola authored and gregkh committed Jan 10, 2024
1 parent a6f440f commit 8b6b3ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,12 +827,13 @@ static int truncate_error_page(struct page *p, unsigned long pfn,
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) {
pr_info("%#lx: Failed to punch page: %d\n", pfn, err);
} else if (page_has_private(p) &&
!try_to_release_page(p, GFP_NOIO)) {
} else if (folio_has_private(folio) &&
!filemap_release_folio(folio, GFP_NOIO)) {
pr_info("%#lx: failed to release buffers\n", pfn);
} else {
ret = MF_RECOVERED;
Expand Down

0 comments on commit 8b6b3ec

Please sign in to comment.