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 _begin_fstest quota auto quick
15 # Override the default cleanup function.
23 # Import common functions.
27 # real QA test starts here
32 _require_xfs_quota_foreign
35 # Setup temporary replacements for /etc/projects and /etc/projid
37 cat >$tmp.projects <<EOF
41 cat >$tmp.projid <<EOF
46 # And make sure we always use our replacements
48 quota_cmd="$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid"
50 _scratch_mkfs >/dev/null 2>&1
51 _scratch_enable_pquota
52 _qmount_option "prjquota"
54 _require_prjquota $SCRATCH_DEV
57 # Create the project root
61 $quota_cmd -x -c 'project -s answer' $SCRATCH_MNT >/dev/null 2>&1
62 $quota_cmd -x -c 'limit -p bhard=100m answer' $SCRATCH_MNT
64 touch $SCRATCH_MNT/test
67 # Try renaming a file into the project. This should fail.
69 # We repeat this a couple thousand times as a single rename couldn't
70 # always trigger the wrong unlock flags bug we had in older kernels.
72 for i in `seq 1 2000`; do
73 $here/src/rename test t/test