From: Boyang Xue <bxue@redhat.com>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org, tytso@mit.edu
Subject: Re: [kernel-5.11 regression] tune2fs fails after shutdown
Date: Thu, 12 Aug 2021 21:38:51 +0800 [thread overview]
Message-ID: <CAHLe9YZCV3Ed5yf=jfOKNeXnJE6mdXepQozVyV=ugn_d4fYR3g@mail.gmail.com> (raw)
In-Reply-To: <20210812124746.GA14675@quack2.suse.cz>
Thanks Jan!
Yes. I will create a test case for fstests.
Thanks,
Boyang
On Thu, Aug 12, 2021 at 8:47 PM Jan Kara <jack@suse.cz> wrote:
>
> Hello Boyang,
>
> On Thu 12-08-21 09:47:30, Boyang Xue wrote:
> > (Adding the author of the commits)
> > Hi Jan,
> >
> > The commit
> >
> > 81414b4dd48 ext4: remove redundant sb checksum recomputation
> >
> > breaks the original reproducer of
> >
> > 4274f516d4bc ext4: recalucate superblock checksum after updating free
> > blocks/inodes
> >
> > I'm wondering is it expected please?
>
> Thanks for report! So for record the problem is not that superblock with
> incorrect checksum would ever get to disk with my patches but the checksum
> will be incorrect in the buffer cache until the moment we start writeout of
> the superblock. And tune2fs accesses the buffer cache and sees the
> incorrect (stale) checksum. It is impossible to fix this problem completely
> (the tune2fs access is fundamentally racy) but yes, I guess returning the
> checksum recalculation back will make the race window small and the cost is
> small. I'll send a patch for this shortly.
>
> Also can you perhaps make this sequence into a fstests testcase for ext4
> filesystem so that we have it covered? Thanks!
>
> Honza
>
> > On Thu, Aug 5, 2021 at 10:35 AM Boyang Xue <bxue@redhat.com> wrote:
> > >
> > > Hi,
> > >
> > > kernel commit
> > >
> > > 4274f516d4bc ext4: recalucate superblock checksum after updating free
> > > blocks/inodes
> > >
> > > had been reverted by
> > >
> > > 81414b4dd48 ext4: remove redundant sb checksum recomputation
> > >
> > > since kernel-5.11-rc1. As a result, the original reproducer fails again.
> > >
> > > Reproducer:
> > > ```
> > > mkdir mntpt
> > > fallocate -l 256M mntpt.img
> > > mkfs.ext4 -Fq -t ext4 mntpt.img 128M
> > > LPDEV=$(losetup -f --show mntpt.img)
> > > mount "$LPDEV" mntpt
> > > cp /proc/version mntpt/
> > > ./godown mntpt # godown program attached.
> > > umount mntpt
> > > mount "$LPDEV" mntpt
> > > tune2fs -l "$LPDEV"
> > > ```
> > >
> > > tune2fs fails with
> > > ```
> > > tune2fs 1.46.2 (28-Feb-2021)
> > > tune2fs: Superblock checksum does not match superblock while trying to
> > > open /dev/loop0
> > > Couldn't find valid filesystem superblock.
> > > ```
> > >
> > > Tested on e2fsprogs-1.46.2 + kernel-5.14.0-0.rc3.29. I think it's a
> > > regression. If this is the case, can we fix it again please?
> > >
> > > Thanks,
> > > Boyang
> >
> --
> Jan Kara <jack@suse.com>
> SUSE Labs, CR
>
prev parent reply other threads:[~2021-08-12 13:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-05 2:35 [kernel-5.11 regression] tune2fs fails after shutdown Boyang Xue
2021-08-12 1:47 ` Boyang Xue
2021-08-12 12:47 ` Jan Kara
2021-08-12 13:38 ` Boyang Xue [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='CAHLe9YZCV3Ed5yf=jfOKNeXnJE6mdXepQozVyV=ugn_d4fYR3g@mail.gmail.com' \
--to=bxue@redhat.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).