4 # test to reproduce PV951636:
5 # project quotas not updated if a file is mv'd into that directory
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
9 #-----------------------------------------------------------------------
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
21 # get standard environment, filters and checks
29 umount $SCRATCH_MNT 2>/dev/null
32 #trap "_cleanup; exit \$status" 0 1 2 3 15
35 # real QA test starts here
37 _supported_os Linux IRIX
39 dir=$SCRATCH_MNT/project
42 cat >$tmp.projects <<EOF
46 cat >$tmp.projid <<EOF
50 cp /dev/null $seq.full
51 chmod a+rwx $seq.full # arbitrary users will write here
54 _scratch_mkfs_xfs >/dev/null 2>&1
56 #if pquota's already in mount options then we dont need to enable
57 [ `echo $MOUNT_OPTIONS | grep -c gquota` -eq 0 -a `echo $MOUNT_OPTIONS | grep -c gquota` -eq 0 ] &&\
58 EXTRA_MOUNT_OPTIONS="-o pquota"
59 [ `echo $MOUNT_OPTIONS | grep -c gquota` -gt 0 -o `echo $MOUNT_OPTIONS | grep -c gquota` -gt 0 ] &&\
60 _notrun "Can't run with group quotas enabled"
62 if ! _scratch_mount "$EXTRA_MOUNT_OPTIONS" >$tmp.out 2>&1
65 echo "!!! mount failed"
69 src/feature -p $SCRATCH_DEV
70 [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
74 $XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
76 xfs_quota -D $tmp.projects -P $tmp.projid -x \
77 -c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
78 xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
83 xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
85 if [ "$HOSTOS" == "IRIX" ] ; then
88 xfs_mkfile 1M $TEST_DIR/6
93 xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
98 xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'