generic: test for file loss after mix of rename, fsync and inode eviction
[xfstests-dev.git] / tests / generic / 117
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FS QA Test No. 117
6 #
7 # Attempt to cause filesystem corruption with serial fsstresses doing
8 # extended attributes writes - pv 940655
9 #
10 . ./common/preamble
11 _begin_fstest attr auto quick
12
13 # seed and options for fsstress known to cause curruptions
14 seed=1122413794
15 fss_ops=" -z \
16     -f attr_remove=100 \
17     -f attr_set=100 \
18     -f chown=3 \
19     -f creat=4 \
20     -f dread=4 \
21     -f dwrite=4 \
22     -f fdatasync=1 \
23     -f fsync=1 \
24     -f getdents=1 \
25     -f link=1 \
26     -f mkdir=2 \
27     -f mknod=2 \
28     -f read=1 \
29     -f readlink=1 \
30     -f rename=2 \
31     -f rmdir=1 \
32     -f setxattr=1 \
33     -f stat=1 \
34     -f symlink=2 \
35     -f sync=1 \
36     -f truncate=2 \
37     -f unlink=1 \
38     -f write=4 \
39     -s $seed \
40     -m 31 -n 1000 -p 1"
41
42 ITERATIONS=10
43
44 # Import common functions.
45 . ./common/filter
46 . ./common/attr
47
48 # real QA test starts here
49 _supported_fs generic
50
51 _require_scratch
52 _require_attrs
53
54 _scratch_unmount >/dev/null 2>&1
55 echo "*** MKFS ***"                         >>$seqres.full
56 echo ""                                     >>$seqres.full
57 _scratch_mkfs                               >>$seqres.full 2>&1 \
58     || _fail "mkfs failed"
59 _scratch_mount
60
61 mkdir -p $SCRATCH_MNT/fsstress
62
63 echo
64 echo Running fsstress in serial:
65 i=0
66 while [ $i -lt $ITERATIONS ]; do
67     echo fsstress iteration: $i | tee -a $seqres.full
68     $FSSTRESS_PROG \
69         -d $SCRATCH_MNT/fsstress \
70         $fss_ops -S c >>$seqres.full 2>&1
71
72     let i=$i+1
73 done
74
75 cd /
76 _scratch_unmount
77 echo 
78 echo Checking filesystem
79
80 status=$?
81 exit