From: Zorro Lang <zlang@kernel.org>
To: Sun Ke <sunke32@huawei.com>
Cc: fstests@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH v2 1/2] ext4: resize fs after resize_inode without e2fsck
Date: Sat, 9 Jul 2022 00:16:24 +0800 [thread overview]
Message-ID: <20220708161624.etkxdewnje4nhmhl@zlang-mailbox> (raw)
In-Reply-To: <20220708112155.2639551-2-sunke32@huawei.com>
On Fri, Jul 08, 2022 at 07:21:54PM +0800, Sun Ke wrote:
> Forget to run requested e2fsck after resize_inode, then resize fs, it
> will trigger off null pointer.
>
> Regression test for commit b55c3cd102a6 ext4: add reserved GDT blocks
> check.
>
> Signed-off-by: Sun Ke <sunke32@huawei.com>
> ---
> tests/ext4/057 | 44 ++++++++++++++++++++++++++++++++++++++++++++
> tests/ext4/057.out | 2 ++
> 2 files changed, 46 insertions(+)
> create mode 100755 tests/ext4/057
> create mode 100644 tests/ext4/057.out
>
> diff --git a/tests/ext4/057 b/tests/ext4/057
> new file mode 100755
> index 00000000..125f841a
> --- /dev/null
> +++ b/tests/ext4/057
> @@ -0,0 +1,44 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2022 HUAWEI. All Rights Reserved.
> +#
> +# FS QA Test 057
> +#
> +# Forget to run requested e2fsck after resize_inode, then resize fs,
> +# it will trigger off null pointer.
> +#
> +# Regression test for commit
> +# b55c3cd102a6 ext4: add reserved GDT blocks check
> +#
> +. ./common/preamble
> +_begin_fstest auto resize quick
> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs ext4
> +_fixed_by_kernel_commit b55c3cd102a6 \
> + "ext4: add reserved GDT blocks check"
> +
> +_require_scratch
> +_require_command "$TUNE2FS_PROG" tune2fs
> +_require_command "$RESIZE2FS_PROG" resize2fs
> +_require_scratch_size $((1024 * 1024)) #kB
> +
> +# set fs size 512M
> +dev_size=$((512 * 1024 * 1024))
> +_scratch_mkfs_sized $dev_size >$seqres.full 2>&1
> +
> +# forget to run requested e2fsck after resize_inode
> +$TUNE2FS_PROG -O ^resize_inode $SCRATCH_DEV >$seqres.full 2>&1
Please use appending write ">>$seqres.full", to avoid seqres.full be
overwritten.
I think we don't need to filter out the error output, we don't expect
there's an error, so if it fails, how about output errors to break
golden image (remind the testers).
> +
> +_scratch_mount
> +
> +# resize fs will trigger NULL pointer in ext4_flex_group_add
> +$RESIZE2FS_PROG $SCRATCH_DEV 1G >$seqres.full 2>&1
Appending write too...
I'm not sure what's the necessary condition to reproduce the bug. Do you
need to resize fs will trigger the bug, but after:
# tune2fs -O ^resize_inode /dev/sda3
Then resize2fs always get:
# resize2fs /dev/sda3 3g
resize2fs 1.45.6 (20-Mar-2020)
Please run 'e2fsck -f /dev/sda3' first.
Looks like the resizing isn't run actually, is it what you really want?
I've tried to review this patch from fstests side, better to get some
review points from ext4 devel, to help to make sure that.
Thanks,
Zorro
> +
> +echo "Silence is golden"
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/ext4/057.out b/tests/ext4/057.out
> new file mode 100644
> index 00000000..185023c7
> --- /dev/null
> +++ b/tests/ext4/057.out
> @@ -0,0 +1,2 @@
> +QA output created by 057
> +Silence is golden
> --
> 2.13.6
>
next prev parent reply other threads:[~2022-07-08 16:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-08 11:21 [PATCH v2 0/2] two regression tests for ext4 Sun Ke
2022-07-08 11:21 ` [PATCH v2 1/2] ext4: resize fs after resize_inode without e2fsck Sun Ke
2022-07-08 16:16 ` Zorro Lang [this message]
2022-07-11 7:32 ` Sun Ke
2022-07-08 11:21 ` [PATCH v2 2/2] ext4: set 256 blocks in a block group then apply io pressure Sun Ke
2022-07-08 15:20 ` Zorro Lang
2022-07-11 7:20 ` Sun Ke
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=20220708161624.etkxdewnje4nhmhl@zlang-mailbox \
--to=zlang@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=sunke32@huawei.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