2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # Run fsstress and ENSPC hitters in parallel, check quota and
8 # fs consistency an the end
11 _begin_fstest auto quota rw prealloc ioctl enospc stress
13 # Import common functions.
17 # Disable all sync operations to get higher load
18 FSSTRESS_AVOID="$FSSTRESS_AVOID -ffsync=0 -fsync=0 -ffdatasync=0"
26 out=$SCRATCH_MNT/fsstress.$$
27 args=`_scale_fsstress_args -p128 -n999999999 -f setattr=1 $FSSTRESS_AVOID -d $out`
28 echo "fsstress $args" >> $seqres.full
29 # Grant chown capability
30 cp $FSSTRESS_PROG $tmp.fsstress.bin
31 $SETCAP_PROG cap_chown=epi $tmp.fsstress.bin
33 # io_uring accounts memory it needs under the rlimit memlocked option,
34 # which can be quite low on some setups (especially 64K pagesize). root
35 # isn't under this restriction, but regular users are. To avoid the
36 # io_uring_queue_init fail on ENOMEM, set max locked memory to unlimited
39 (su $qa_user -c "$tmp.fsstress.bin $args" &) > /dev/null 2>&1
41 echo "Run dd writers in parallel"
42 for ((i=0; i < num_iterations; i++))
44 # File will be opened with O_TRUNC each time
45 su $qa_user -c "dd if=/dev/zero \
46 of=$SCRATCH_MNT/SPACE_CONSUMER bs=1M " \
51 $KILLALL_PROG -w $tmp.fsstress.bin
54 # real QA test starts here
59 _require_command "$KILLALL_PROG" killall
60 _require_command "$SETCAP_PROG" setcap
62 _scratch_mkfs_sized $((512 * 1024 * 1024)) >> $seqres.full 2>&1
63 _scratch_mount "-o usrquota,grpquota"
64 chmod 777 $SCRATCH_MNT
65 quotacheck -u -g $SCRATCH_MNT 2>/dev/null
66 quotaon -u -g $SCRATCH_MNT 2>/dev/null
69 _scratch_unmount 2>/dev/null
73 if ! _check_quota_usage; then
74 _scratch_unmount 2>/dev/null
79 echo Comparing filesystem consistency
80 if ! _scratch_unmount; then
81 echo "failed to umount"