blob: a8278b0ee500f5915421100fbd1f670ebb4a9151 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
#
# FSQA Test No. 035
#
# Regression test for commit:
# f96c3ac8dfc2 ("ext4: fix crash during online resizing")
#
# This case tests a loss s_first_data_block on ext4 when computing
# maximum size with given number of group descriptor blocks. Filesystem
# with non-zero s_first_data_block can happen that computed maximum size
# lower than current size and leads to a BUG_ON in in ext4_alloc_group_tables()
# hitting on flex_gd->count == 0.
#
. ./common/preamble
_begin_fstest auto quick resize
# Import common functions.
. ./common/filter
# real QA test starts here
_supported_fs ext4
_require_scratch
_exclude_scratch_mount_option dax
_require_command "$RESIZE2FS_PROG" resize2fs
encrypt=
if echo "${MOUNT_OPTIONS}" | grep -q 'test_dummy_encryption' ; then
encrypt="-O encrypt"
fi
$MKFS_EXT4_PROG -F -b 1024 -E "resize=262144" $encrypt $SCRATCH_DEV 32768 >> $seqres.full 2>&1
if [ $? -ne 0 ]; then
_notrun "Can't make file system with a block size of 1024"
fi
_scratch_mount
echo "Resizing to 262145 blocks"
$RESIZE2FS_PROG $SCRATCH_DEV 262145 >> $seqres.full 2>&1
echo "Resizing to 300000 blocks"
$RESIZE2FS_PROG $SCRATCH_DEV 300000 >> $seqres.full 2>&1
# success, all done
status=0
exit
|