All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Zorro Lang <zlang@redhat.com>
Cc: Sun Ke <sunke32@huawei.com>,
	fstests@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH v3 1/2] ext4: resize fs after resize_inode without e2fsck
Date: Thu, 14 Jul 2022 18:00:34 -0400	[thread overview]
Message-ID: <YtCSAjiMc9RElnHu@mit.edu> (raw)
In-Reply-To: <20220714154607.qq6cqgvncxhsn66w@zlang-mailbox>

On Thu, Jul 14, 2022 at 11:46:07PM +0800, Zorro Lang wrote:
> On Wed, Jul 13, 2022 at 05:28:58PM +0800, Sun Ke wrote:
> > +
> > +# forget to run requested e2fsck after resize_inode
> > +$TUNE2FS_PROG -O ^resize_inode $SCRATCH_DEV | grep -w "e2fsck"
> > +
> > +_scratch_mount
> > +
> > +# resize fs will trigger NULL pointer in ext4_flex_group_add
> > +$RESIZE2FS_PROG $SCRATCH_DEV 1G >> $seqres.full 2>&1
> > +
> > +echo "Silence is golden"
  ...
> > diff --git a/tests/ext4/057.out b/tests/ext4/057.out
> > new file mode 100644
> > index 00000000..4784ad7e
> > --- /dev/null
> > +++ b/tests/ext4/057.out
> > @@ -0,0 +1,3 @@
> > +QA output created by 057
> > +Please run e2fsck -f on the filesystem.
> 
> If you hope to match this line, means this case isn't "Silence is golden".
> 
> I don't know why you'd to have this line, it looks not suit to be golden
> image. If you'd like to make sure current ext4 supports "resize_inode"
> feature, you can use:
>   _require_scratch_ext4_feature resize_inode

That's not the problem.

The "tune2fs -O ^resize_inode" command is printing that message as a
reminder that it would be a Really Good idea to run e2fsck on the file
system, because tune2fs doesn't completely remove the resize inode
after turning off that feature.

The commit which this test is trying to verify is that the kernel
won't oops if the system adminsitrator ignores the rather explicit
request:

Please run e2fsck -f on the filesystem.

... and blithely mounts the file system without running fsck -f on the
file system first.  While it could be argued that a system
administrator which fails to follow instructions deserves everything
they get, we decided the as a quality of implementation issue, it
would be better if the kernel didn't dereference a NULL pointer in
that case.  :-)

The one thing I'll note is that it is possible that at some point in
the future, tune2fs could be improved so that it cleanly removes the
resize_inode when the resize inode feature is removed, so that running
"fsck.ext4 -f" is no longer necessary.  So if you want to future-proof
the test so it doesn't fail once tune2fs is made more idiot-proof, it
might be better if the test did something like this:

mke2fs -t ext4 -O ^resize_inode /dev/vdc 512m
debugfs -w -R "set_super_value s_reserved_gdt_blocks 100" /dev/vdc
mount -t ext4 /dev/vdc /vdc
resize2fs /dev/vdc 1G

Translating the above from commands suitable for manual trial using
"kvm-xfstests shell" to a proper xfstests script is left as an
exercise for the reader.  :-)

					- Ted

  reply	other threads:[~2022-07-14 22:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13  9:28 [PATCH v3 0/2] two regression tests for ext4 Sun Ke
2022-07-13  9:28 ` [PATCH v3 1/2] ext4: resize fs after resize_inode without e2fsck Sun Ke
2022-07-14 15:46   ` Zorro Lang
2022-07-14 22:00     ` Theodore Ts'o [this message]
2022-07-15 18:08       ` Zorro Lang
2022-07-21  3:24         ` Sun Ke
2022-07-22  8:16         ` Sun Ke
2022-07-22 11:51           ` Theodore Ts'o
2022-07-22 15:11             ` Zorro Lang
2022-07-22 16:36               ` Theodore Ts'o
2022-07-13  9:28 ` [PATCH v3 2/2] ext4: set 256 blocks in a block group then apply io pressure Sun Ke
2022-07-14 16:02   ` Zorro Lang

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=YtCSAjiMc9RElnHu@mit.edu \
    --to=tytso@mit.edu \
    --cc=fstests@vger.kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sunke32@huawei.com \
    --cc=zlang@redhat.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 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.