check: use generated group files
[xfstests-dev.git] / tests / ext4 / 035
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
4 #
5 # FSQA Test No. 035
6 #
7 # Regression test for commit:
8 # f96c3ac8dfc2 ("ext4: fix crash during online resizing")
9 #
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.
15 #
16 . ./common/preamble
17 _begin_fstest auto quick resize
18
19 # Import common functions.
20 . ./common/filter
21
22 # real QA test starts here
23 _supported_fs ext4
24 _require_scratch
25 _exclude_scratch_mount_option dax
26 _require_command "$RESIZE2FS_PROG" resize2fs
27
28 $MKFS_EXT4_PROG -F -b 1024 -E "resize=262144" $SCRATCH_DEV 32768 >> $seqres.full 2>&1
29 _scratch_mount
30
31 echo "Resizing to 262145 blocks"
32 $RESIZE2FS_PROG $SCRATCH_DEV 262145 >> $seqres.full 2>&1
33
34 echo "Resizing to 300000 blocks"
35 $RESIZE2FS_PROG $SCRATCH_DEV 300000 >> $seqres.full 2>&1
36
37 # success, all done
38 status=0
39 exit