4 # Make sure renames accross project boundaries are properly rejected
5 # and that we don't use the wrong lock flags internally.
7 # Based on a report and testcase from Arkadiusz Miskiewicz <arekm@maven.pl>
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2008 Christoph Hellwig.
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 #-----------------------------------------------------------------------
28 seqres=$RESULT_DIR/$seq
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
41 trap "_cleanup; exit \$status" 0 1 2 3 15
43 # get standard environment, filters and checks
48 # real QA test starts here
56 # Setup temporary replacements for /etc/projects and /etc/projid
58 cat >$tmp.projects <<EOF
62 cat >$tmp.projid <<EOF
67 # And make sure we always use our replacements
69 quota_cmd="xfs_quota -D $tmp.projects -P $tmp.projid"
71 _scratch_mkfs_xfs >/dev/null 2>&1
72 _qmount_option "pquota"
76 # Create the project root
80 $quota_cmd -x -c 'project -s answer' $SCRATCH_MNT >/dev/null 2>&1
81 $quota_cmd -x -c 'limit -p bhard=100m answer' $SCRATCH_MNT
83 touch $SCRATCH_MNT/test
86 # Try renaming a file into the project. This should fail.
88 # We repeat this a couple thousand times as a single rename couldn't
89 # always trigger the wrong unlock flags bug we had in older kernels.
91 for i in `seq 1 2000`; do
92 src/rename test t/test