4 # Test xfs' "fail at unmount" error handling configuration. Stop
5 # XFS from retrying to writeback forever at unmount.
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2016 Red Hat, Inc. All Rights Reserved.
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
31 status=1 # failure is the default!
32 trap "_cleanup; exit \$status" 0 1 2 3 15
41 # get standard environment, filters and checks
46 # remove previous $seqres.full before test
49 # real QA test starts here
53 _require_dm_target error
54 _require_fs_sysfs error/fail_at_unmount
56 _scratch_mkfs > $seqres.full 2>&1
60 # Make sure all error handling attributes are original status
61 _reset_xfs_sysfs_error_handling $DMERROR_DEV
63 # Make sure fail_at_unmount is enabled, so XFS stops retrying on
64 # errors at unmount time. _fail the test if we fail to set it to 1,
65 # because the test probably will hang in such case and block
67 attr=`_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount`
68 if [ "$attr" != "1" ]; then
69 _fail "Failed to set error/fail_at_unmount: $attr"
72 # start a metadata-intensive workload, but no data allocation operation.
73 # Because uncompleted new space allocation I/Os may cause XFS to shutdown
74 # after loading error table.
75 $FSSTRESS_PROG -z -n 5000 -p 10 \
87 -d $SCRATCH_MNT/fsstress >> $seqres.full 2>&1
89 # Loading error table without "--nolockfs" option. Because "--nolockfs"
90 # won't freeze fs, then some running I/Os may cause XFS to shutdown
91 # prematurely. That's not what we want to test.
92 _dmerror_load_error_table lockfs
95 # Mount again to replay log after loading working table, so we have a
96 # consistent XFS after test.
97 _dmerror_load_working_table