generic/554: hide permision warning on exfat
[xfstests-dev.git] / tests / generic / 380
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 380
6 #
7 # To test out pv#940675 crash in xfs_trans_brelse + quotas
8 # Without the fix, this will create an ASSERT failure in debug kernels
9 # and crash a non-debug kernel.
10 #
11 seq=`basename $0`
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
14
15 here=`pwd`
16 tmp=/tmp/$$
17 status=1        # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 15
19
20 _cleanup()
21 {
22     cd /
23     rm -f $tmp.*
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29 . ./common/quota
30
31 # real QA test starts here
32
33 # Modify as appropriate.
34 _supported_fs generic
35
36 _require_scratch
37 _require_quota
38 _require_xfs_quota_foreign
39
40 _chowning_file()
41 {
42         file=file.chown
43         let start=$1
44         let limit=$2
45         let delta=$3
46
47         cd $SCRATCH_MNT
48         let count=$start
49         while (( count < limit )); do
50             touch $file
51             chown $count.$count $file
52             echo -n "."
53             let count=count+delta
54         done
55         echo ""
56 }
57
58 echo "mkfs on scratch"
59 _scratch_mkfs >$seqres.full 2>&1
60
61 echo "mount with quotas"
62 export MOUNT_OPTIONS="-o usrquota"
63 _scratch_mount
64
65 echo "creating quota file with holes"
66 _chowning_file 1000 2000 100
67
68 echo "now fill in the holes"
69 _chowning_file 1000 2000 1
70
71 echo "look at the final file ownership for fun"
72 ls -l $SCRATCH_MNT/* \
73 | $AWK_PROG 'NF > 2 {print $3, $4, $NF}' \
74 | sed "s#$SCRATCH_MNT#SCRATCH_MNT#g"
75
76 # success, all done
77 status=0
78 exit