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
39 _require_xfs_quota_foreign
42 # Setup temporary replacements for /etc/projects and /etc/projid
44 cat >$tmp.projects <<EOF
48 cat >$tmp.projid <<EOF
53 # And make sure we always use our replacements
55 quota_cmd="$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid"
57 _scratch_mkfs >/dev/null 2>&1
58 _scratch_enable_pquota
59 _qmount_option "prjquota"
61 _require_prjquota $SCRATCH_DEV
64 # Create the project root
68 $quota_cmd -x -c 'project -s answer' $SCRATCH_MNT >/dev/null 2>&1
69 $quota_cmd -x -c 'limit -p bhard=100m answer' $SCRATCH_MNT
71 touch $SCRATCH_MNT/test
74 # Try renaming a file into the project. This should fail.
76 # We repeat this a couple thousand times as a single rename couldn't
77 # always trigger the wrong unlock flags bug we had in older kernels.
79 for i in `seq 1 2000`; do
80 $here/src/rename test t/test