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
56 rm -f $seqres.full $tmp.*
58 _require_scratch_shutdown
61 QUOTA_OPTION=`_get_quota_option`
64 _scratch_unmount >/dev/null 2>&1
66 _scratch_mkfs >/dev/null 2>&1
67 _require_metadata_journaling $SCRATCH_DEV
69 _get_log_configs > $tmp.seq.params
72 | while read mkfs mnt restofline
74 if [ "$mkfs" = "#" ]; then
78 echo "--- mkfs=$mkfs, mnt=$mnt ---" >> $seqres.full
79 export MKFS_OPTIONS="-l $mkfs"
80 export MOUNT_OPTIONS="-o $mnt"
84 _scratch_mkfs >>$seqres.full 2>&1
85 if [ $? -ne 0 ] ; then
86 _echofull "mkfs failed: $MKFS_OPTIONS"
92 if ! _try_scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1; then
93 _echofull "mount failed: $MOUNT_OPTIONS"
100 # check before on what FS should look like
101 _echofull "ls -RF SCRATCH_MNT"
102 ls -RF $SCRATCH_MNT >$tmp.ls1
105 _scratch_shutdown -v -f >> $seqres.full
108 _scratch_unmount >>$seqres.full 2>&1 \
109 || _fail "umount failed"
111 _echofull "logprint after going down..."
114 _full "logprint headers"
115 _scratch_xfs_logprint -n >>$seqres.full 2>&1
117 _echofull "mount with replay"
118 _try_scratch_mount $QUOTA_OPTION >>$seqres.full 2>&1 \
119 || _fail "mount failed: $MOUNT_OPTIONS"
121 # check on what FS looks like after log recovery
122 _echofull "ls -RF SCRATCH_MNT"
123 ls -RF $SCRATCH_MNT >$tmp.ls2
125 _echofull "diff ls before and after"
126 diff -us $tmp.ls1 $tmp.ls2 | sed "s#$tmp#TMP#g"
131 _echofull "logprint after mount and replay..."
134 if _check_scratch_fs; then
135 _echofull "filesystem is checked ok"
137 _echofull "filesystem is NOT ok"