3 #-----------------------------------------------------------------------
4 # Copyright (c) 2006 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # test to reproduce PV951636:
24 # project quotas not updated if a file is mv'd into that directory
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
36 # get standard environment, filters and checks
44 umount $SCRATCH_MNT 2>/dev/null
47 #trap "_cleanup; exit \$status" 0 1 2 3 15
50 # real QA test starts here
52 _supported_os Linux IRIX
56 dir=$SCRATCH_MNT/project
59 cat >$tmp.projects <<EOF
63 cat >$tmp.projid <<EOF
67 cp /dev/null $seq.full
68 chmod a+rwx $seq.full # arbitrary users will write here
71 _scratch_mkfs_xfs >/dev/null 2>&1
73 #if pquota's already in mount options then we dont need to enable
75 # we can't run with group quotas
76 if ( `echo $MOUNT_OPTIONS | grep -q gquota` || `echo $MOUNT_OPTIONS | grep -q grpquota` )
78 _notrun "Can't run with group quotas enabled"
80 EXTRA_MOUNT_OPTIONS="-o pquota"
82 if ! _scratch_mount "$EXTRA_MOUNT_OPTIONS" >$tmp.out 2>&1
85 echo "!!! mount failed"
89 src/feature -p $SCRATCH_DEV
90 [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas"
94 $XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
96 xfs_quota -D $tmp.projects -P $tmp.projid -x \
97 -c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
98 xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
103 xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
105 if [ "$HOSTOS" == "IRIX" ] ; then
106 mkfile 1M $TEST_DIR/6
108 xfs_mkfile 1M $TEST_DIR/6
112 cp $TEST_DIR/6 $dir/6
113 xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'
116 mv $TEST_DIR/6 $dir/7
118 xfs_quota -D $tmp.projects -P $tmp.projid -x -c "repquota -inN -p" $SCRATCH_DEV | tr -s '[:space:]'