2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2008 Christoph Hellwig.
7 # Make sure renames accross project boundaries are properly rejected
8 # and that we don't use the wrong lock flags internally.
10 # Based on a report and testcase from Arkadiusz Miskiewicz <arekm@maven.pl>
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
26 trap "_cleanup; exit \$status" 0 1 2 3 15
28 # get standard environment, filters and checks
33 # real QA test starts here
38 _require_xfs_quota_foreign
41 # Setup temporary replacements for /etc/projects and /etc/projid
43 cat >$tmp.projects <<EOF
47 cat >$tmp.projid <<EOF
52 # And make sure we always use our replacements
54 quota_cmd="$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid"
56 _scratch_mkfs >/dev/null 2>&1
57 _scratch_enable_pquota
58 _qmount_option "prjquota"
60 _require_prjquota $SCRATCH_DEV
63 # Create the project root
67 $quota_cmd -x -c 'project -s answer' $SCRATCH_MNT >/dev/null 2>&1
68 $quota_cmd -x -c 'limit -p bhard=100m answer' $SCRATCH_MNT
70 touch $SCRATCH_MNT/test
73 # Try renaming a file into the project. This should fail.
75 # We repeat this a couple thousand times as a single rename couldn't
76 # always trigger the wrong unlock flags bug we had in older kernels.
78 for i in `seq 1 2000`; do
79 $here/src/rename test t/test