2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # Run fsstress with quotas enabled and limits set low and verify accounted
10 # Derived from test 231
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20 # get standard environment, filters and checks
27 tee -a $seqres.full |\
28 sed -e 's/[0-9][0-9]* inodes/I inodes/g' \
29 -e 's/[0-9][0-9]* paths/P paths/g' \
30 -e 's/seed = [0-9][0-9]*/seed = S/'
36 echo "Testing fsstress"
39 out=$SCRATCH_MNT/fsstress.$$
41 args=`_scale_fsstress_args -z \
42 -f rmdir=20 -f link=10 -f creat=10 -f mkdir=10 -f unlink=20 -f symlink=10 \
43 -f rename=10 -f fsync=2 -f write=15 -f dwrite=15 \
44 -n $count -d $out -p 7`
46 # io_uring accounts memory it needs under the rlimit memlocked option,
47 # which can be quite low on some setups (especially 64K pagesize). root
48 # isn't under this restriction, but regular users are. To avoid the
49 # io_uring_queue_init fail on ENOMEM, set max locked memory to unlimited
52 echo "fsstress $args" >> $seqres.full
53 if ! su $qa_user -c "$FSSTRESS_PROG $args" | tee -a $seqres.full | _filter_num
55 echo " fsstress $args returned $?"
56 cat $tmp.out | tee -a $seqres.full
61 # real QA test starts here
67 _scratch_mkfs > $seqres.full 2>&1
68 _scratch_mount "-o usrquota,grpquota"
69 chmod 777 $SCRATCH_MNT
70 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
71 quotaon -u -g $SCRATCH_MNT 2>/dev/null
72 setquota -u $qa_user 32000 32000 1000 1000 $SCRATCH_MNT 2>/dev/null