summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_sysfs.c
diff options
context:
space:
mode:
authorCarlos Maiolino2016-05-18 03:09:28 +0200
committerDave Chinner2016-05-18 03:09:28 +0200
commite0a431b3a3cc3d0a4c38ccfca8c7320fde40efb6 (patch)
tree66ded33cb0840fca7f2b0f986a4e14401e34ba9c /fs/xfs/xfs_sysfs.c
parentxfs: add configuration of error failure speed (diff)
downloadkernel-qcow2-linux-e0a431b3a3cc3d0a4c38ccfca8c7320fde40efb6.tar.gz
kernel-qcow2-linux-e0a431b3a3cc3d0a4c38ccfca8c7320fde40efb6.tar.xz
kernel-qcow2-linux-e0a431b3a3cc3d0a4c38ccfca8c7320fde40efb6.zip
xfs: add configuration handlers for specific errors
now most of the infrastructure is in place, we can start adding support for configuring specific errors such as ENODEV, ENOSPC, EIO, etc. Add these error configurations and configure them all to have appropriate behaviours. That is, 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 Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_sysfs.c')
-rw-r--r--fs/xfs/xfs_sysfs.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
index 918d144febd9..084a606840a1 100644
--- a/fs/xfs/xfs_sysfs.c
+++ b/fs/xfs/xfs_sysfs.c
@@ -478,9 +478,20 @@ struct xfs_error_init {
static const struct xfs_error_init xfs_error_meta_init[XFS_ERR_ERRNO_MAX] = {
{ .name = "default",
- .max_retries = -1,
+ .max_retries = XFS_ERR_RETRY_FOREVER,
.retry_timeout = 0,
},
+ { .name = "EIO",
+ .max_retries = XFS_ERR_RETRY_FOREVER,
+ .retry_timeout = 0,
+ },
+ { .name = "ENOSPC",
+ .max_retries = XFS_ERR_RETRY_FOREVER,
+ .retry_timeout = 0,
+ },
+ { .name = "ENODEV",
+ .max_retries = 0,
+ },
};
static int
@@ -578,6 +589,15 @@ xfs_error_get_cfg(
struct xfs_error_cfg *cfg;
switch (error) {
+ case EIO:
+ cfg = &mp->m_error_cfg[error_class][XFS_ERR_EIO];
+ break;
+ case ENOSPC:
+ cfg = &mp->m_error_cfg[error_class][XFS_ERR_ENOSPC];
+ break;
+ case ENODEV:
+ cfg = &mp->m_error_cfg[error_class][XFS_ERR_ENODEV];
+ break;
default:
cfg = &mp->m_error_cfg[error_class][XFS_ERR_DEFAULT];
break;