Lisa Wang <[email protected]> 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 <[email protected]>

Reply via email to