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@xxxxxxxxxx> --- 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 + +# real QA test starts here + +# Modify as appropriate. +_supported_fs ext4 +_require_scratch +_require_command "$TUNE2FS_PROG" tune2fs +_require_command "$RESIZE2FS_PROG" resize2 + + +# 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 +$RESIZE2FS_PROG $SCRATCH_DEV 8G >/dev/null 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..185023c7 --- /dev/null +++ b/tests/ext4/057.out @@ -0,0 +1,2 @@ +QA output created by 057 +Silence is golden -- 2.13.6