All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: Sun Ke <sunke32@huawei.com>
Cc: 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 23:46:07 +0800	[thread overview]
Message-ID: <20220714154607.qq6cqgvncxhsn66w@zlang-mailbox> (raw)
In-Reply-To: <20220713092859.3881376-2-sunke32@huawei.com>

On Wed, Jul 13, 2022 at 05:28:58PM +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 |  3 +++
>  2 files changed, 47 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..44dae76c
> --- /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 | 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"
> +
> +# success, all done
> +status=0
> +exit
> 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

Thanks,
Zorro

> +Silence is golden
> -- 
> 2.13.6
> 


  reply	other threads:[~2022-07-14 15:46 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 [this message]
2022-07-14 22:00     ` Theodore Ts'o
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=20220714154607.qq6cqgvncxhsn66w@zlang-mailbox \
    --to=zlang@redhat.com \
    --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 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.