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
35 _require_command "$LDD_PROG" ldd
38 # xfs_scrub will turn on error injection itself
39 _require_xfs_io_error_injection "force_repair"
41 echo "Format and populate"
42 _scratch_mkfs > "$seqres.full" 2>&1
44 cp $XFS_SCRUB_PROG $SCRATCH_MNT/xfs_scrub
45 $LDD_PROG $XFS_SCRUB_PROG | sed -e '/\//!d;/linux-gate/d;/=>/ {s/.*=>[[:blank:]]*\([^[:blank:]]*\).*/\1/};s/[[:blank:]]*\([^[:blank:]]*\) (.*)/\1/' | while read lib; do
48 LD_LIBRARY_PATH=$SCRATCH_MNT $LDD_PROG $SCRATCH_MNT/xfs_scrub >> $seqres.full
50 echo "Force online repairs"
51 XFS_SCRUB_FORCE_REPAIR=1 LD_LIBRARY_PATH=$SCRATCH_MNT $SCRATCH_MNT/xfs_scrub -dTvy $SCRATCH_MNT >> $seqres.full