2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2014 Red Hat Inc. All Rights Reserved.
5 # FS QA Test No. generic/558
7 # Stress test fs by using up all inodes and check fs.
9 # Also a regression test for xfsprogs commit
10 # d586858 xfs_repair: fix sibling pointer tests in verify_dir2_path()
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
34 while [ $i -lt $nr_file ]; do
35 echo -n > $dir/${prefix}_${i}
40 # get standard environment, filters and checks
44 # real QA test starts here
50 echo "Silence is golden"
52 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1
56 free_inode=`_get_free_inode $SCRATCH_MNT`
58 loop=$((free_inode / file_per_dir + 1))
59 mkdir -p $SCRATCH_MNT/testdir
61 echo "Create $((loop * file_per_dir)) files in $SCRATCH_MNT/testdir" >>$seqres.full
62 while [ $i -lt $loop ]; do
63 create_file $SCRATCH_MNT/testdir $file_per_dir $i >>$seqres.full 2>&1 &
68 # log inode status in $seqres.full for debug purpose
69 echo "Inode status after taking all inodes" >>$seqres.full
70 $DF_PROG -i $SCRATCH_MNT >>$seqres.full
74 # Check again after removing all the files
75 rm -rf $SCRATCH_MNT/testdir
76 echo "Inode status after deleting all test files" >>$seqres.full
77 $DF_PROG -i $SCRATCH_MNT >>$seqres.full