2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
7 # test to reproduce PV951636:
8 # project quotas not updated if a file is mv'd into that directory
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
18 # get standard environment, filters and checks
26 _scratch_unmount 2>/dev/null
29 trap "_cleanup; exit \$status" 0 1 2 3 15
31 # real QA test starts here
37 _require_xfs_quota_foreign
38 _require_xfs_io_command "chproj"
40 # we can't run with group quotas (on v4 xfs); the mount options for group
41 # quotas will be filtered out by _qmount_option below.
43 dir=$SCRATCH_MNT/project
46 cat >$tmp.projects <<EOF
50 cat >$tmp.projid <<EOF
54 cp /dev/null $seqres.full
55 chmod a+rwx $seqres.full # arbitrary users will write here
58 _scratch_mkfs >/dev/null 2>&1
59 _scratch_enable_pquota
61 _qmount_option "prjquota"
63 _require_prjquota $SCRATCH_DEV
67 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
68 -c "repquota -inN -p" $SCRATCH_DEV | \
69 tr -s '[:space:]' | _filter_project_quota
73 $XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
75 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
76 -c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
84 xfs_mkfile 1M $TEST_DIR/6