From: Daeho Jeong <daeho43@gmail.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH] fsck.f2fs: don't call dev_fill w/ null buffer
Date: Tue, 13 Aug 2024 10:36:14 -0700 [thread overview]
Message-ID: <CACOAw_yTYtiRW5cKD8G4npfyu1FK3__NhRhWo02Kp98jRzDgkg@mail.gmail.com> (raw)
In-Reply-To: <Zrpo9ylEc6_ivUQ0@google.com>
On Mon, Aug 12, 2024 at 12:56 PM Jaegeuk Kim <jaegeuk@kernel.org> wrote:
>
> On 08/12, Daeho Jeong wrote:
> > On Thu, Aug 8, 2024 at 4:34 PM Jaegeuk Kim <jaegeuk@kernel.org> wrote:
> > >
> > > It'll crach fsck.f2fs. Even, let's keep the write pointers and just finish it.
> > >
> > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> > > ---
> > > fsck/fsck.c | 20 ++++++++------------
> > > 1 file changed, 8 insertions(+), 12 deletions(-)
> > >
> > > diff --git a/fsck/fsck.c b/fsck/fsck.c
> > > index a18bee9d0c3b..5fe8ad4ef327 100644
> > > --- a/fsck/fsck.c
> > > +++ b/fsck/fsck.c
> > > @@ -3299,8 +3299,9 @@ static int chk_and_fix_wp_with_sit(int UNUSED(i), void *blkzone, void *opaque)
> > > "segment 0x%x", zone_segno);
> > > ret = f2fs_reset_zone(wpd->dev_index, blkz);
> > > if (ret) {
> > > - printf("[FSCK] Write pointer reset "
> > > - "failed: %s\n", dev->path);
> > > + ASSERT_MSG("Write pointer reset "
> > > + "failed: %s, err=%d\n",
> > > + dev->path, ret);
> > > return ret;
> > > }
> > > fsck->chk.wp_fixed = 1;
> > > @@ -3326,18 +3327,13 @@ static int chk_and_fix_wp_with_sit(int UNUSED(i), void *blkzone, void *opaque)
> > >
> > > ret = f2fs_finish_zone(wpd->dev_index, blkz);
> > > if (ret) {
> > > - u64 fill_sects = blk_zone_length(blkz) -
> > > - (blk_zone_wp_sector(blkz) - blk_zone_sector(blkz));
> > > - printf("[FSCK] Finishing zone failed: %s\n", dev->path);
> > > - ret = dev_fill(NULL, wp_block * F2FS_BLKSIZE,
> > > - (fill_sects >> log_sectors_per_block) * F2FS_BLKSIZE);
> >
> > This was for zoned devices that don't support the FINISH command. If
> > NULL buf is the problem, how about using zero value filled buffer?
>
> Do we really need to fill them, if it'll be reset later before use?
That's for devices not supporting the FINISH command. Let me make
another patch for it.
>
> >
> > > - if (ret)
> > > - printf("[FSCK] Fill up zone failed: %s\n", dev->path);
> > > + ASSERT_MSG("Finishing zone failed: %s, err=%d\n",
> > > + dev->path, ret);
> > > + return ret;
> > > }
> > >
> > > - if (!ret)
> > > - fsck->chk.wp_fixed = 1;
> > > - return ret;
> > > + fsck->chk.wp_fixed = 1;
> > > + return 0;
> > > }
> > >
> > > static void fix_wp_sit_alignment(struct f2fs_sb_info *sbi)
> > > --
> > > 2.46.0.76.ge559c4bf1a-goog
> > >
> > >
> > >
> > > _______________________________________________
> > > Linux-f2fs-devel mailing list
> > > Linux-f2fs-devel@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2024-08-13 17:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 23:32 [f2fs-dev] [PATCH] fsck.f2fs: don't call dev_fill w/ null buffer Jaegeuk Kim
2024-08-12 18:41 ` Daeho Jeong
2024-08-12 19:56 ` Jaegeuk Kim
2024-08-13 17:36 ` Daeho Jeong [this message]
2024-08-14 10:07 ` Chao Yu
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=CACOAw_yTYtiRW5cKD8G4npfyu1FK3__NhRhWo02Kp98jRzDgkg@mail.gmail.com \
--to=daeho43@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).