2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Oracle, Inc. All Rights Reserved.
7 # Copy xfs_scrub to the scratch device, then run xfs_scrub in forced
8 # repair mode (which will rebuild the data forks of the running scrub
9 # executable and libraries!) to see what happens.
12 seqres=$RESULT_DIR/$seq
13 echo "QA output created by $seq"
17 status=1 # failure is the default!
18 trap "_cleanup; exit \$status" 0 1 2 3 7 15
26 # get standard environment, filters and checks
32 # real QA test starts here
34 _require_command "$LDD_PROG" ldd
37 # xfs_scrub will turn on error injection itself
38 _require_xfs_io_error_injection "force_repair"
40 echo "Format and populate"
41 _scratch_mkfs > "$seqres.full" 2>&1
43 cp $XFS_SCRUB_PROG $SCRATCH_MNT/xfs_scrub
44 $LDD_PROG $XFS_SCRUB_PROG | sed -e '/\//!d;/linux-gate/d;/=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' | while read lib; do
47 LD_LIBRARY_PATH=$SCRATCH_MNT $LDD_PROG $SCRATCH_MNT/xfs_scrub >> $seqres.full
49 echo "Force online repairs"
50 XFS_SCRUB_FORCE_REPAIR=1 LD_LIBRARY_PATH=$SCRATCH_MNT $SCRATCH_MNT/xfs_scrub -dTv $SCRATCH_MNT >> $seqres.full