public inbox for linux-ext4@vger.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 1/2] ext4/057: resize fs after resize_inode without e2fsck
Date: Thu, 7 Jul 2022 23:00:52 +0800	[thread overview]
Message-ID: <20220707150052.a624coefjchegzm6@zlang-mailbox> (raw)
In-Reply-To: <20220707135917.373342-2-sunke32@huawei.com>

On Thu, Jul 07, 2022 at 09:59:16PM +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>
> ---

Don't use a fixed case number for a new case. It might not be "057" when
I merge it.

>  tests/ext4/057     | 41 +++++++++++++++++++++++++++++++++++++++++
>  tests/ext4/057.out |  2 ++
>  2 files changed, 43 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..dacc14be
> --- /dev/null
> +++ b/tests/ext4/057
> @@ -0,0 +1,41 @@
> +#! /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

This's a "resize" related test, and I think it'll be "quick" enough if you
use smaller fs size to test.

> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs ext4
> +_require_scratch

_fixed_by_kernel_commit() is recommended, if this's a known regression test.

> +_require_command "$TUNE2FS_PROG" tune2fs
> +_require_command "$RESIZE2FS_PROG" resize2
                                             ^^
resize2fs ?

> +
> +
> +# set fs size 3G
> +dev_size=$((3 * 1024 * 1024 * 1024))
> +_scratch_mkfs_sized $dev_size >/dev/null 2>&1
> +
> +# forget to run requested e2fsck after resize_inode
> +$TUNE2FS_PROG -O ^resize_inode $SCRATCH_DEV >/dev/null 2>&1
> +
> +_scratch_mount
> +
> +# resize fs from 3G to 8G

This comment is useless. You can describe what's expected, and what
kind of bug might be trigger at here.

> +$RESIZE2FS_PROG $SCRATCH_DEV 8G >/dev/null 2>&1

Better to print to $seqres.full, to help debug if need.

Better use _require_scratch_size at beginning, to make sure you have enough
space. BTW, do you really need such big size to trigger this bug? Better to
figure out if you can use smaller size (e.g. 512m to 1g) to help this
case always can be run, even with small test devices.

> +
> +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
> 


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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 13:59 [PATCH 0/2] two regression tests for ext4 Sun Ke
2022-07-07 13:59 ` [PATCH 1/2] ext4/057: resize fs after resize_inode without e2fsck Sun Ke
2022-07-07 15:00   ` Zorro Lang [this message]
2022-07-07 13:59 ` [PATCH 2/2] ext4/058: set 256 blocks in a block group Set 256 blocks in a block group Sun Ke
2022-07-07 15:18   ` Zorro Lang
2022-07-08 11:03     ` 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=20220707150052.a624coefjchegzm6@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox