]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xfs: add configuration handlers for specific errors
authorCarlos Maiolino <cmaiolino@redhat.com>
Wed, 18 May 2016 01:09:28 +0000 (11:09 +1000)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 10 Jun 2017 00:25:17 +0000 (17:25 -0700)
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>
(cherry picked from commit e0a431b3a3cc3d0a4c38ccfca8c7320fde40efb6)

Orabug: 26130728

Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
fs/xfs/xfs_mount.h
fs/xfs/xfs_sysfs.c

index 90da00b3e178416e82b6ea3a2df8486056426a9d..ad4ba7898848b1dc96c0b43a4208946fc7ae7921 100644 (file)
@@ -49,6 +49,9 @@ enum {
 };
 enum {
        XFS_ERR_DEFAULT,
+       XFS_ERR_EIO,
+       XFS_ERR_ENOSPC,
+       XFS_ERR_ENODEV,
        XFS_ERR_ERRNO_MAX,
 };
 
index 604863f60f760031950fc0e63529c250c2f3e1f1..fb2f3069291d2d14907225bb0ba151d20f313328 100644 (file)
@@ -387,9 +387,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
@@ -487,6 +498,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;