2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2021 Huawei. All Rights Reserved.
7 # Regression test for kernel commit a149d2a5cabb (ext4: fix check to prevent
8 # false positive report of incorrect used inodes)
11 _begin_fstest auto quick
13 # Import common functions.
16 # real QA test starts here
20 sdev=$(_short_dev ${SCRATCH_DEV})
21 # default sleep interval
24 echo "+ create scratch fs"
25 _scratch_mkfs_ext4 -b 4096 -g 8192 -N 1024 -I 4096 >> $seqres.full 2>&1
28 _scratch_mount -o errors=remount-ro
29 # The default maximum wake-up delay of the lazy init thread of ext4 is
30 # EXT4_DEF_LI_MAX_START_DELAY (5s).
31 # After mounting the file system, the lazy init thread will be awakened to
32 # perform group initialization at 0~5s after the current time. If an error
33 # is detected during the initialization process, it will be set to read-only,
34 # so the test case needs to delay a little while waiting for the init thread
38 echo "+ check mountpoint status"
39 cat /proc/self/mounts | grep -w ${SCRATCH_MNT} | \
40 $AWK_PROG '{print $4}' | grep -oE '^rw,' | tee -a $seqres.full
42 echo "+ check mountpoint writability"
43 test -w $SCRATCH_MNT || echo "scratch mount should still be writable"
46 _check_dmesg_for "\(${sdev}\): Remounting filesystem read-only" && \
47 echo "scratch dev should not be remounted to read-only"