2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
7 # Test xfs' "fail at unmount" error handling configuration. Stop
8 # XFS from retrying to writeback forever at unmount.
11 seqres=$RESULT_DIR/$seq
12 echo "QA output created by $seq"
16 status=1 # failure is the default!
17 trap "_cleanup; exit \$status" 0 1 2 3 15
26 # get standard environment, filters and checks
31 # remove previous $seqres.full before test
34 # real QA test starts here
37 _require_dm_target error
38 _require_fs_sysfs error/fail_at_unmount
40 _scratch_mkfs > $seqres.full 2>&1
44 # Make sure all error handling attributes are original status
45 _reset_xfs_sysfs_error_handling $DMERROR_DEV
47 # Make sure fail_at_unmount is enabled, so XFS stops retrying on
48 # errors at unmount time. _fail the test if we fail to set it to 1,
49 # because the test probably will hang in such case and block
51 attr=`_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount`
52 if [ "$attr" != "1" ]; then
53 _fail "Failed to set error/fail_at_unmount: $attr"
56 # start a metadata-intensive workload, but no data allocation operation.
57 # Because uncompleted new space allocation I/Os may cause XFS to shutdown
58 # after loading error table.
59 $FSSTRESS_PROG -z -n 5000 -p 10 \
71 -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
73 # Loading error table without "--nolockfs" option. Because "--nolockfs"
74 # won't freeze fs, then some running I/Os may cause XFS to shutdown
75 # prematurely. That's not what we want to test.
76 _dmerror_load_error_table lockfs
79 # Mount again to replay log after loading working table, so we have a
80 # consistent XFS after test.
81 _dmerror_load_working_table