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
38 _require_dm_target error
39 _require_fs_sysfs error/fail_at_unmount
41 _scratch_mkfs > $seqres.full 2>&1
45 # Make sure all error handling attributes are original status
46 _reset_xfs_sysfs_error_handling $DMERROR_DEV
48 # Make sure fail_at_unmount is enabled, so XFS stops retrying on
49 # errors at unmount time. _fail the test if we fail to set it to 1,
50 # because the test probably will hang in such case and block
52 attr=`_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount`
53 if [ "$attr" != "1" ]; then
54 _fail "Failed to set error/fail_at_unmount: $attr"
57 # start a metadata-intensive workload, but no data allocation operation.
58 # Because uncompleted new space allocation I/Os may cause XFS to shutdown
59 # after loading error table.
60 $FSSTRESS_PROG -z -n 5000 -p 10 \
72 -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
74 # Loading error table without "--nolockfs" option. Because "--nolockfs"
75 # won't freeze fs, then some running I/Os may cause XFS to shutdown
76 # prematurely. That's not what we want to test.
77 _dmerror_load_error_table lockfs
80 # Mount again to replay log after loading working table, so we have a
81 # consistent XFS after test.
82 _dmerror_load_working_table