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
36 _require_xfs_quota_foreign
37 _require_xfs_io_command "chproj"
39 # we can't run with group quotas (on v4 xfs); the mount options for group
40 # quotas will be filtered out by _qmount_option below.
42 dir=$SCRATCH_MNT/project
45 cat >$tmp.projects <<EOF
49 cat >$tmp.projid <<EOF
53 cp /dev/null $seqres.full
54 chmod a+rwx $seqres.full # arbitrary users will write here
57 _scratch_mkfs >/dev/null 2>&1
58 _scratch_enable_pquota
60 _qmount_option "prjquota"
62 _require_prjquota $SCRATCH_DEV
66 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
67 -c "repquota -inN -p" $SCRATCH_DEV | \
68 tr -s '[:space:]' | _filter_project_quota
72 $XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
74 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
75 -c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
83 xfs_mkfile 1M $TEST_DIR/6