2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved.
7 # * like 054 but want to create more/different kinds of metadata
8 # and so will use fsstress
9 # * also can interrupt metadata with godown
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
20 # get standard environment, filters and checks
28 out=$SCRATCH_MNT/fsstress
30 param="-p 4 -z -f rmdir=10 -f link=10 -f creat=10 -f mkdir=10 \
31 -f rename=30 -f stat=30 -f unlink=30 -f truncate=20"
32 _echofull "calling fsstress $param -m8 -n $count"
33 FSSTRESS_ARGS=`_scale_fsstress_args $param $FSSTRESS_AVOID -m 8 -n $count -d $out`
34 if ! $FSSTRESS_PROG $FSSTRESS_ARGS >>$seqres.full 2>&1
36 _echofull "fsstress failed"
52 # real QA test starts here
55 rm -f $seqres.full $tmp.*
57 _require_scratch_shutdown
60 QUOTA_OPTION=`_get_quota_option`
63 _scratch_unmount >/dev/null 2>&1
65 _scratch_mkfs >/dev/null 2>&1
66 _require_metadata_journaling $SCRATCH_DEV
68 _get_log_configs > $tmp.seq.params
71 | while read mkfs mnt restofline
73 if [ "$mkfs" = "#" ]; then
77 echo "--- mkfs=$mkfs, mnt=$mnt ---" >> $seqres.full
78 export MKFS_OPTIONS="-l $mkfs"
79 export MOUNT_OPTIONS="-o $mnt"
83 _scratch_mkfs >>$seqres.full 2>&1
84 if [ $? -ne 0 ] ; then
85 _echofull "mkfs failed: $MKFS_OPTIONS"
91 if ! _try_scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1; then
92 _echofull "mount failed: $MOUNT_OPTIONS"
99 # check before on what FS should look like
100 _echofull "ls -RF SCRATCH_MNT"
101 ls -RF $SCRATCH_MNT >$tmp.ls1
104 _scratch_shutdown -v -f >> $seqres.full
107 _scratch_unmount >>$seqres.full 2>&1 \
108 || _fail "umount failed"
110 _echofull "logprint after going down..."
113 _full "logprint headers"
114 _scratch_xfs_logprint -n >>$seqres.full 2>&1
116 _echofull "mount with replay"
117 _try_scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1 \
118 || _fail "mount failed: $MOUNT_OPTIONS"
120 # check on what FS looks like after log recovery
121 _echofull "ls -RF SCRATCH_MNT"
122 ls -RF $SCRATCH_MNT >$tmp.ls2
124 _echofull "diff ls before and after"
125 diff -us $tmp.ls1 $tmp.ls2 | sed "s#$tmp#TMP#g"
130 _echofull "logprint after mount and replay..."
133 if _check_scratch_fs; then
134 _echofull "filesystem is checked ok"
136 _echofull "filesystem is NOT ok"