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 _begin_fstest auto quick mount eio
13 # Override the default cleanup function.
21 # Import common functions.
25 # real QA test starts here
28 _require_dm_target error
29 _require_fs_sysfs error/fail_at_unmount
31 _scratch_mkfs > $seqres.full 2>&1
35 # Make sure all error handling attributes are original status
36 _reset_xfs_sysfs_error_handling $DMERROR_DEV
38 # Make sure fail_at_unmount is enabled, so XFS stops retrying on
39 # errors at unmount time. _fail the test if we fail to set it to 1,
40 # because the test probably will hang in such case and block
42 attr=`_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount`
43 if [ "$attr" != "1" ]; then
44 _fail "Failed to set error/fail_at_unmount: $attr"
47 # start a metadata-intensive workload, but no data allocation operation.
48 # Because uncompleted new space allocation I/Os may cause XFS to shutdown
49 # after loading error table.
50 $FSSTRESS_PROG -z -n 5000 -p 10 \
62 -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
64 # Loading error table without "--nolockfs" option. Because "--nolockfs"
65 # won't freeze fs, then some running I/Os may cause XFS to shutdown
66 # prematurely. That's not what we want to test.
67 _dmerror_load_error_table lockfs
70 # Mount again to replay log after loading working table, so we have a
71 # consistent XFS after test.
72 _dmerror_load_working_table