All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: fengnan chang <fengnanchang@gmail.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH v2] f2fs: fix hungtask when decompressed fail
Date: Tue, 1 Nov 2022 20:48:05 -0700	[thread overview]
Message-ID: <Y2HodQZHpNupi+l9@sol.localdomain> (raw)
In-Reply-To: <CALWNXx9-EtdXpGJONESQAQ9aOK9=Ggk9n0U+wxy-Wxq+sBcXkg@mail.gmail.com>

On Wed, Nov 02, 2022 at 11:43:11AM +0800, fengnan chang wrote:
> > > > What is the purpose of using PG_error here?
> > >
> > > In this version, we set PG_error when compressed failed, so check PG_error here.
> > > Maybe we can remove PG_error in later?
> > >
> >
> > Read I/O errors can be detected via PG_uptodate not being set.  There shouldn't
> > be any need for PG_error here.
> 
> Yeah, I get it now. Maybe we can remove PG_error in f2fs_verify_cluster too.
> 
> diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c
> index d315c2de136f..13c0bfe45804 100644
> --- a/fs/f2fs/compress.c
> +++ b/fs/f2fs/compress.c
> @@ -1727,10 +1727,9 @@ static void __f2fs_decompress_end_io(struct
> decompress_io_ctx *dic, bool failed,
>                         continue;
> 
>                 /* PG_error was set if verity failed. */
> -               if (failed || PageError(rpage)) {
> -                       ClearPageUptodate(rpage);
> +               if (failed) {
>                         /* will re-read again later */
> -                       ClearPageError(rpage);
> +                       ClearPageUptodate(rpage);
>                 } else {
>                         SetPageUptodate(rpage);
>                 }
> @@ -1745,13 +1744,14 @@ static void f2fs_verify_cluster(struct
> work_struct *work)
>         struct decompress_io_ctx *dic =
>                 container_of(work, struct decompress_io_ctx, verity_work);
>         int i;
> +       bool failed = false;
> 
>         /* Verify the cluster's decompressed pages with fs-verity. */
>         for (i = 0; i < dic->cluster_size; i++) {
>                 struct page *rpage = dic->rpages[i];
> 
>                 if (rpage && !fsverity_verify_page(rpage))
> -                       SetPageError(rpage);
> +                       failed = true;
>         }

No, PG_error is still used to notify f2fs_finish_read_bio() and
__f2fs_decompress_end_io() of verity errors.  My patch
https://lore.kernel.org/r/20221028175807.55495-1-ebiggers@kernel.org changes
that.  Please leave that to my patch.  For your patch, please just don't add a
new use of PG_error, as it doesn't seem to be necessary.

- Eric


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      reply	other threads:[~2022-11-02  3:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 13:48 [f2fs-dev] [PATCH v2] f2fs: fix hungtask when decompressed fail Fengnan Chang
2022-10-14  8:46 ` fengnan chang
2022-11-01  9:41   ` fengnan chang
2022-11-01 15:06     ` Chao Yu
2022-11-02  2:05 ` Eric Biggers
2022-11-02  3:06   ` fengnan chang
2022-11-02  3:18     ` Eric Biggers
2022-11-02  3:43       ` fengnan chang
2022-11-02  3:48         ` Eric Biggers [this message]

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=Y2HodQZHpNupi+l9@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=fengnanchang@gmail.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.