2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
7 # Regression test for commit:
8 # f96c3ac8dfc2 ("ext4: fix crash during online resizing")
10 # This case tests a loss s_first_data_block on ext4 when computing
11 # maximum size with given number of group descriptor blocks. Filesystem
12 # with non-zero s_first_data_block can happen that computed maximum size
13 # lower than current size and leads to a BUG_ON in in ext4_alloc_group_tables()
14 # hitting on flex_gd->count == 0.
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
22 status=1 # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
31 # get standard environment, filters and checks
35 # real QA test starts here
38 _exclude_scratch_mount_option dax
39 _require_command "$RESIZE2FS_PROG" resize2fs
43 $MKFS_EXT4_PROG -F -b 1024 -E "resize=262144" $SCRATCH_DEV 32768 >> $seqres.full 2>&1
46 echo "Resizing to 262145 blocks"
47 $RESIZE2FS_PROG $SCRATCH_DEV 262145 >> $seqres.full 2>&1
49 echo "Resizing to 300000 blocks"
50 $RESIZE2FS_PROG $SCRATCH_DEV 300000 >> $seqres.full 2>&1