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
51 echo "Silence is golden"
53 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1
57 free_inode=`_get_free_inode $SCRATCH_MNT`
59 loop=$((free_inode / file_per_dir + 1))
60 mkdir -p $SCRATCH_MNT/testdir
62 echo "Create $((loop * file_per_dir)) files in $SCRATCH_MNT/testdir" >>$seqres.full
63 while [ $i -lt $loop ]; do
64 create_file $SCRATCH_MNT/testdir $file_per_dir $i >>$seqres.full 2>&1 &
69 # log inode status in $seqres.full for debug purpose
70 echo "Inode status after taking all inodes" >>$seqres.full
71 $DF_PROG -i $SCRATCH_MNT >>$seqres.full
75 # Check again after removing all the files
76 rm -rf $SCRATCH_MNT/testdir
77 echo "Inode status after deleting all test files" >>$seqres.full
78 $DF_PROG -i $SCRATCH_MNT >>$seqres.full