linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nhat Pham <nphamcs@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: hannes@cmpxchg.org, yosryahmed@google.com,
	chengming.zhou@linux.dev,  linux-mm@kvack.org,
	kernel-team@meta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] zswap: do not crash the kernel on decompression failure
Date: Tue, 25 Feb 2025 14:28:20 -0800	[thread overview]
Message-ID: <CAKEwX=MuKwhnooRO4pHH_UqGStMdH5RHbxnYJtYmqLhBBE0StA@mail.gmail.com> (raw)
In-Reply-To: <20250225142518.cec35a0ea77a0d86f3e860c3@linux-foundation.org>

On Tue, Feb 25, 2025 at 2:25 PM Andrew Morton <akpm@linux-foundation.org> wrote:
>
> On Tue, 25 Feb 2025 13:32:00 -0800 Nhat Pham <nphamcs@gmail.com> wrote:
>
> > @@ -984,12 +987,19 @@ static void zswap_decompress(struct zswap_entry *entry, struct folio *folio)
> >       sg_init_table(&output, 1);
> >       sg_set_folio(&output, folio, PAGE_SIZE, 0);
> >       acomp_request_set_params(acomp_ctx->req, &input, &output, entry->length, PAGE_SIZE);
> > -     BUG_ON(crypto_wait_req(crypto_acomp_decompress(acomp_ctx->req), &acomp_ctx->wait));
> > -     BUG_ON(acomp_ctx->req->dlen != PAGE_SIZE);
> > +     if (crypto_wait_req(crypto_acomp_decompress(acomp_ctx->req), &acomp_ctx->wait) ||
> > +                     acomp_ctx->req->dlen != PAGE_SIZE) {
> > +             ret = false;
> > +             zswap_reject_decompress_fail++;
> > +             pr_alert_ratelimited(
> > +                     "decompression failed on zswap entry with offset %08lx\n",
> > +                     entry->swpentry.val);
> > +     }
> >       mutex_unlock(&acomp_ctx->mutex);
>
> This mutex_unlock() isn't present in current kernels.  I'd normally just fix
> the reject but a change in the locking environment needs some careful
> checking and retesting, please.

Hah strange. I could have sworn I pulled the latest mm-unstable, but
maybe the git pull failed and I didn't notice. Thanks for picking this
up Andrew! Lemme re-pull and rebase.


  reply	other threads:[~2025-02-25 22:28 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25 21:32 Nhat Pham
2025-02-25 22:25 ` Andrew Morton
2025-02-25 22:28   ` Nhat Pham [this message]
2025-02-26  0:51 ` Johannes Weiner
2025-02-26  2:45   ` Yosry Ahmed
2025-02-26  3:57     ` Johannes Weiner
2025-02-26 15:42       ` Yosry Ahmed
2025-02-26 23:39   ` Nhat Pham
2025-02-26  2:40 ` Yosry Ahmed
2025-02-26 23:16   ` Nhat Pham
2025-02-27  0:03     ` Yosry Ahmed
2025-02-26  3:12 ` Yosry Ahmed
2025-02-26  4:57   ` Johannes Weiner
2025-02-26 15:33     ` Yosry Ahmed
2025-02-26 23:20       ` Nhat Pham
2025-02-27  0:00         ` Yosry Ahmed
2025-02-26 23:29   ` Nhat Pham
2025-02-26 23:58     ` Yosry Ahmed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKEwX=MuKwhnooRO4pHH_UqGStMdH5RHbxnYJtYmqLhBBE0StA@mail.gmail.com' \
    --to=nphamcs@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chengming.zhou@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=yosryahmed@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox