Re: [PATCH v2] zswap: do not crash the kernel on decompression failure

Nhat Pham
2025-02-27T22:35:18Z

On Thu, Feb 27, 2025 at 8:05 AM Johannes Weiner <hannes@cmpxchg.org> wrote:
>
> On Thu, Feb 27, 2025 at 07:29:45AM +0000, Yosry Ahmed wrote:

I like this actually,

> I'd actually rather push those down into zeromap and zswap as well to
> follow that pattern more closely:
>
> diff --git a/mm/page_io.c b/mm/page_io.c
> index 9b983de351f9..1fb5ce1884bd 100644
> --- a/mm/page_io.c
> +++ b/mm/page_io.c
> @@ -538,6 +538,7 @@ static bool swap_read_folio_zeromap(struct folio *folio)
>
> folio_zero_range(folio, 0, folio_size(folio));
> folio_mark_uptodate(folio);

There should be another folio_unlock() above I think.

> + folio_unlock(folio);
> return true;
> }
>