mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfs/006: refactor reset error handling code to common/rc
Nearly 1/3 code is used to reset the xfs error handling attributes, This part can be picked up, and used for other cases. So move them to a new function _reset_xfs_sysfs_error_handling() in common/rc. Signed-off-by: Zorro Lang <zlang@redhat.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
+7
-20
@@ -57,31 +57,18 @@ _scratch_mkfs > $seqres.full 2>&1
|
||||
_dmerror_init
|
||||
_dmerror_mount
|
||||
|
||||
# Enable fail_at_unmount, so XFS stops retrying on errors at unmount
|
||||
# time. _fail the test if we fail to set it to 1, because the test
|
||||
# probably will hang in such case and block subsequent tests.
|
||||
_set_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount 1
|
||||
# Make sure all error handling attributes are original status
|
||||
reset_xfs_sysfs_error_handling $DMERROR_DEV
|
||||
|
||||
# Make sure fail_at_unmount is enabled, so XFS stops retrying on
|
||||
# errors at unmount time. _fail the test if we fail to set it to 1,
|
||||
# because the test probably will hang in such case and block
|
||||
# subsequent tests.
|
||||
attr=`_get_fs_sysfs_attr $DMERROR_DEV error/fail_at_unmount`
|
||||
if [ "$attr" != "1" ]; then
|
||||
_fail "Failed to set error/fail_at_unmount: $attr"
|
||||
fi
|
||||
|
||||
# Make sure all will be configured to retry forever by default, except
|
||||
# for ENODEV, which is an unrecoverable error, so it will be configured
|
||||
# to not retry on error by default.
|
||||
for e in default EIO ENOSPC; do
|
||||
_set_fs_sysfs_attr $DMERROR_DEV \
|
||||
error/metadata/${e}/max_retries -1
|
||||
echo -n "error/metadata/${e}/max_retries="
|
||||
_get_fs_sysfs_attr $DMERROR_DEV error/metadata/${e}/max_retries
|
||||
|
||||
_set_fs_sysfs_attr $DMERROR_DEV \
|
||||
error/metadata/${e}/retry_timeout_seconds 0
|
||||
echo -n "error/metadata/${e}/retry_timeout_seconds="
|
||||
_get_fs_sysfs_attr $DMERROR_DEV \
|
||||
error/metadata/${e}/retry_timeout_seconds
|
||||
done
|
||||
|
||||
# start a metadata-intensive workload, but no data allocation operation.
|
||||
# Because uncompleted new space allocation I/Os may cause XFS to shutdown
|
||||
# after loading error table.
|
||||
|
||||
Reference in New Issue
Block a user