@@ -1146,7 +1146,8 @@ xfs_buf_iodone_callback_error(
goto permanent_error;
/* At unmount we may treat errors differently */
- if ((mp->m_flags & XFS_MOUNT_UNMOUNTING) && mp->m_eobj.fail_unmount)
+ if ((mp->m_flags & XFS_MOUNT_UNMOUNTING) &&
+ xfs_fail_at_unmount(&mp->m_eobj))
goto permanent_error;
/*
@@ -475,5 +475,6 @@ int xfs_zero_extent(struct xfs_inode *ip, xfs_fsblock_t start_fsb,
void xfs_error_get_cfg(struct xfs_error_obj *eobj,
int error_class, int error, struct xfs_error_cfg *cfg);
+bool xfs_fail_at_unmount(struct xfs_error_obj *eobj);
#endif /* __XFS_MOUNT_H__ */
@@ -713,6 +713,7 @@ xfs_error_get_cfg(
struct xfs_error_cfg *cfg)
{
int idx;
+ struct xfs_error_cfg_kobj *kobj;
if (error < 0)
error = -error;
@@ -732,5 +733,21 @@ xfs_error_get_cfg(
break;
}
- *cfg = eobj->cfg_kobj[error_class][idx].cfg;
+ *cfg = xfs_dft_eobj.cfg_kobj[error_class][idx].cfg;
+
+ kobj = &eobj->cfg_kobj[error_class][idx];
+ if (test_bit(XFS_ERR_CFG_BIT_PRIV_MAX_RETRIES, &kobj->flags))
+ cfg->max_retries = kobj->cfg.max_retries;
+ if (test_bit(XFS_ERR_CFG_BIT_PRIV_RETRY_TIMEOUT, &kobj->flags))
+ cfg->retry_timeout = kobj->cfg.retry_timeout;
+}
+
+bool
+xfs_fail_at_unmount(
+ struct xfs_error_obj *eobj)
+{
+ if (!test_bit(XFS_ERR_CFG_BIT_PRIV_FAIL_UNMOUNT, &eobj->flags))
+ return xfs_dft_eobj.fail_unmount;
+ else
+ return eobj->fail_unmount;
}
When a corresponding XFS_ERR_CFG_BIT_* bit had been set on the error configuration, the value of the fs-specific error configuration will be returned, else the value of the default error configuration will be used. Signed-off-by: Hou Tao <houtao1@huawei.com> --- fs/xfs/xfs_buf_item.c | 3 ++- fs/xfs/xfs_mount.h | 1 + fs/xfs/xfs_sysfs.c | 19 ++++++++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-)