[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aCJdUQ5Jpo5JmJpW@casper.infradead.org>
Date: Mon, 12 May 2025 21:42:57 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Nhat Pham <nphamcs@...il.com>
Cc: akpm@...ux-foundation.org, hannes@...xchg.org, yosryahmed@...gle.com,
yosry.ahmed@...ux.dev, chengming.zhou@...ux.dev, linux-mm@...ck.org,
kernel-team@...a.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] page_io: zswap: do not crash the kernel on
decompression failure
On Mon, May 12, 2025 at 03:49:29PM -0400, Nhat Pham wrote:
> Not a bad idea, just no usecase yet. From the POV of
> zswap_decompress()'s callers, any decompression failure is handled the
> same way, no matter the cause.
>
> Where it might be useful is the debug print statement right below
> this. However, zstd and lz4 only return 0 or -EINVAL, I think - not
> super useful.
>
> https://github.com/torvalds/linux/blob/master/crypto/zstd.c#L163-L165
> https://github.com/torvalds/linux/blob/master/crypto/lz4.c#L61
>
> Not sure about other compressors.
OK, fair enough. If there's no better information to return, then
this way is fine.
> > (also i really dislike the chained approach:
> >
> > decomp_ret = crypto_wait_req(crypto_acomp_decompress(acomp_ctx->req), &acomp_ctx->wait);
> >
> > that's much harder to understand than the two lines i have above)
>
> I can send a style fix sometimes if people dislike this - no big deal :)
>
> BTW, hopefully you don't mind the Suggested-by: tag. I know it
> deviated a bit from your original suggestion, but the main spirit of
> that suggestion remains, so I feel like I should credit you and Yosry.
The Suggested-by is appropriate, I think.
Powered by blists - more mailing lists