common: kill _supported_os
[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 seq=`basename $0`
17 seqres=$RESULT_DIR/$seq
18 echo "QA output created by $seq"
19
20 here=`pwd`
21 tmp=/tmp/$$
22 status=1        # failure is the default!
23 trap "_cleanup; exit \$status" 0 1 2 3 15
24
25 _cleanup()
26 {
27         cd /
28         rm -f $tmp.*
29 }
30
31 # get standard environment, filters and checks
32 . ./common/rc
33 . ./common/filter
34
35 # real QA test starts here
36 _supported_fs ext4
37 _require_scratch
38 _exclude_scratch_mount_option dax
39 _require_command "$RESIZE2FS_PROG" resize2fs
40
41 rm -f $seqres.full
42
43 $MKFS_EXT4_PROG -F -b 1024 -E "resize=262144" $SCRATCH_DEV 32768 >> $seqres.full 2>&1
44 _scratch_mount
45
46 echo "Resizing to 262145 blocks"
47 $RESIZE2FS_PROG $SCRATCH_DEV 262145 >> $seqres.full 2>&1
48
49 echo "Resizing to 300000 blocks"
50 $RESIZE2FS_PROG $SCRATCH_DEV 300000 >> $seqres.full 2>&1
51
52 # success, all done
53 status=0
54 exit