2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
5 # FS QA Test No. ext4/036
7 # Test truncate orphan inodes when mounting ext4
8 # ext4 used to hit WARNING, this commit fixed the issue
10 # 721e3eb ext4: lock i_mutex when truncating orphan inodes
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
27 # get standard environment, filters and checks
31 # real QA test starts here
32 _supported_fs ext3 ext4
36 echo "Silence is golden"
38 _scratch_mkfs_sized $((16*1024*1024)) >>$seqres.full 2>&1
41 # create a file and get its inode number, usually it's 12, but to be accurate
42 testfile=$SCRATCH_MNT/testfile
44 inode=`ls -i $testfile | awk '{print $1}'`
46 # add the inode in orphan inode list
48 debugfs -w -R "set_super_value last_orphan $inode" $SCRATCH_DEV \
51 # mount again to truncate orphan inode, _check_dmesg will catch the WARNING