Re: [PATCH v4 4/7] mm: memory_failure: Generalize extra_pins handling to all MF_DELAYED cases

From: Ackerley Tng

Date: Wed Jun 17 2026 - 09:22:07 EST


Lisa Wang <wyihan@xxxxxxxxxx> writes:

>
> [...snip...]
>
> diff --git a/mm/memory-failure.c b/mm/memory-failure.c
> index 3aff0c981fcd..dcc56bedcb28 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -1052,18 +1052,14 @@ static int me_pagecache_clean(struct page_state *ps, struct page *p)
> goto out;
> }
>
> - /*
> - * The shmem page is kept in page cache instead of truncating
> - * so is expected to have an extra refcount after error-handling.
> - */
> - extra_pins = shmem_mapping(mapping);
> -
> /*
> * Truncation is a bit tricky. Enable it per file system for now.
> *
> * Open: to take i_rwsem or not for this? Right now we don't.
> */
> ret = truncate_error_folio(folio, page_to_pfn(p), mapping);
> +
> + extra_pins = ret == MF_DELAYED;
> if (has_extra_refcount(ps, p, extra_pins))
> ret = MF_FAILED;
>

Reviewed-by: Ackerley Tng <ackerleytng@xxxxxxxxxx>