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 _begin_fstest auto enospc
22 while [ $i -lt $nr_file ]; do
23 echo -n > $dir/${prefix}_${i}
28 # Import common functions.
31 # real QA test starts here
36 echo "Silence is golden"
38 _scratch_mkfs_sized $((1024 * 1024 * 1024)) >>$seqres.full 2>&1
42 free_inode=`_get_free_inode $SCRATCH_MNT`
44 loop=$((free_inode / file_per_dir + 1))
45 mkdir -p $SCRATCH_MNT/testdir
47 echo "Create $((loop * file_per_dir)) files in $SCRATCH_MNT/testdir" >>$seqres.full
48 while [ $i -lt $loop ]; do
49 create_file $SCRATCH_MNT/testdir $file_per_dir $i >>$seqres.full 2>&1 &
54 # log inode status in $seqres.full for debug purpose
55 echo "Inode status after taking all inodes" >>$seqres.full
56 $DF_PROG -i $SCRATCH_MNT >>$seqres.full
60 # Check again after removing all the files
61 rm -rf $SCRATCH_MNT/testdir
62 echo "Inode status after deleting all test files" >>$seqres.full
63 $DF_PROG -i $SCRATCH_MNT >>$seqres.full