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 _begin_fstest auto quick quota
13 # Override the default cleanup function.
21 # Import common functions.
25 # real QA test starts here
30 _scratch_mkfs >/dev/null 2>&1
31 _scratch_enable_pquota
32 _qmount_option "prjquota"
34 _require_prjquota $SCRATCH_DEV
36 # Create a directory to be project object, and create a file to take 64k space
38 $XFS_IO_PROG -f -c "pwrite 0 65536" -c sync $SCRATCH_MNT/t/file >>$seqres.full
40 quota_cmd="$XFS_QUOTA_PROG -x"
41 $quota_cmd -c "project -s -p $SCRATCH_MNT/t 42" $SCRATCH_MNT >/dev/null 2>&1
42 $quota_cmd -c 'limit -p isoft=53 bsoft=100m 42' $SCRATCH_MNT
44 # The itotal and size should be 53 and 102400(k), as above project quota limit.
45 # The isued and used should be 2 and 64(k), as this case takes.
46 df -k --output=file,itotal,iused,size,used $SCRATCH_MNT/t | \
47 _filter_scratch | _filter_spaces