generic: test for creating duplicate filenames in encrypted dir
[xfstests-dev.git] / tests / generic / 585
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2019 Tencent.  All Rights Reserved.
4 #
5 # FS QA Test No. 585
6 #
7 # Regression test for:
8 #    bc56ad8c74b8: ("xfs: Fix deadlock between AGI and AGF with RENAME_WHITEOUT")
9 #
10 seq=`basename $0`
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
13
14 here=`pwd`
15 tmp=/tmp/$$
16 status=1        # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
18
19 _cleanup()
20 {
21         cd /
22         rm -f $tmp.*
23 }
24
25 # get standard environment, filters and checks
26 . ./common/rc
27 . ./common/filter
28 . ./common/renameat2
29
30 # remove previous $seqres.full before test
31 rm -f $seqres.full
32
33 # real QA test starts here
34 _supported_fs generic
35 _require_scratch
36 _require_renameat2 whiteout
37
38 _scratch_mkfs > $seqres.full 2>&1 || _fail "mkfs failed"
39 _scratch_mount >> $seqres.full 2>&1
40
41 # start a create and rename(rename_whiteout) workload. These processes
42 # occur simultaneously may cause the deadlock between AGI and AGF with
43 # RENAME_WHITEOUT.
44 $FSSTRESS_PROG -z -n 150 -p 100 \
45                 -f mknod=5 \
46                 -f rwhiteout=5 \
47                 -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
48
49 echo Silence is golden
50
51 # Failure comes in the form of a deadlock.
52
53 # success, all done
54 status=0
55 exit