2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2019 Red Hat, Inc. All Rights Reserved.
7 # Test statfs when project quota is set.
8 # Uncover de7243057 fs/xfs: fix f_ffree value for statfs when project quota is set
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
31 # remove previous $seqres.full before test
34 # real QA test starts here
39 _scratch_mkfs >/dev/null 2>&1
40 _scratch_enable_pquota
41 _qmount_option "prjquota"
43 _require_prjquota $SCRATCH_DEV
45 # Create a directory to be project object, and create a file to take 64k space
47 $XFS_IO_PROG -f -c "pwrite 0 65536" -c sync $SCRATCH_MNT/t/file >>$seqres.full
49 quota_cmd="$XFS_QUOTA_PROG -x"
50 $quota_cmd -c "project -s -p $SCRATCH_MNT/t 42" $SCRATCH_MNT >/dev/null 2>&1
51 $quota_cmd -c 'limit -p isoft=53 bsoft=100m 42' $SCRATCH_MNT
53 # The itotal and size should be 53 and 102400(k), as above project quota limit.
54 # The isued and used should be 2 and 64(k), as this case takes.
55 df -k --output=file,itotal,iused,size,used $SCRATCH_MNT/t | \
56 _filter_scratch | _filter_spaces