common: kill _supported_os
[xfstests-dev.git] / tests / generic / 481
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (C) 2018 Oracle. All Rights Reserved.
4 #
5 # FSQA Test No. 481
6 #
7 # Reproduce a regression of btrfs that leads to -EEXIST on creating new files
8 # after log replay.
9 #
10 # The kernel fix is
11 #   Btrfs: fix unexpected -EEXIST when creating new inode
12 #
13 seq=`basename $0`
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
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         _cleanup_flakey
23         cd /
24         rm -f $tmp.*
25 }
26
27 # get standard environment, filters and checks
28 . ./common/rc
29 . ./common/filter
30 . ./common/dmflakey
31
32 # real QA test starts here
33 _supported_fs generic
34 _require_scratch
35 _require_dm_target flakey
36
37 rm -f $seqres.full
38
39 _scratch_mkfs >>$seqres.full 2>&1
40 _require_metadata_journaling $SCRATCH_DEV
41 _init_flakey
42 _mount_flakey
43
44 # create a file and keep it in write ahead log
45 $XFS_IO_PROG -f -c "fsync" $SCRATCH_MNT/foo
46
47 # fail this filesystem so that remount can replay the write ahead log
48 _flakey_drop_and_remount
49
50 # see if we can create a new file successfully
51 touch $SCRATCH_MNT/bar
52
53 _unmount_flakey
54
55 echo "Silence is golden"
56
57 status=0
58 exit