aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Maiolino <cmaiolino@redhat.com>2016-05-17 21:01:00 -0400
committerDave Chinner <david@fromorbit.com>2016-05-17 21:01:00 -0400
commitffd40ef697dfd3e06f44b1bb5fea93079de8c77d (patch)
treebd0c6c9286e453b6076c43033d0a4a86ab752727
parent192852be8b5fb14268c2133fe9ce5312e4745963 (diff)
xfs: introduce metadata IO error class
Now we have the basic infrastructure, add the first error class so we can build up the infrastructure in a meaningful way. Add the metadata async write IO error class and sysfs entry, and introduce a default configuration that matches the existing "retry forever" behavior for async write metadata buffers. 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>
-rw-r--r--fs/xfs/xfs_mount.h3
-rw-r--r--fs/xfs/xfs_sysfs.c34
2 files changed, 37 insertions, 0 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index d639795b0310..352a5c88d7e9 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -44,9 +44,11 @@ enum {
44 * Error numbers define the errors that are configurable. 44 * Error numbers define the errors that are configurable.
45 */ 45 */
46enum { 46enum {
47 XFS_ERR_METADATA,
47 XFS_ERR_CLASS_MAX, 48 XFS_ERR_CLASS_MAX,
48}; 49};
49enum { 50enum {
51 XFS_ERR_DEFAULT,
50 XFS_ERR_ERRNO_MAX, 52 XFS_ERR_ERRNO_MAX,
51}; 53};
52 54
@@ -146,6 +148,7 @@ typedef struct xfs_mount {
146 /* low free space thresholds */ 148 /* low free space thresholds */
147 struct xfs_kobj m_kobj; 149 struct xfs_kobj m_kobj;
148 struct xfs_kobj m_error_kobj; 150 struct xfs_kobj m_error_kobj;
151 struct xfs_kobj m_error_meta_kobj;
149 struct xfs_error_cfg m_error_cfg[XFS_ERR_CLASS_MAX][XFS_ERR_ERRNO_MAX]; 152 struct xfs_error_cfg m_error_cfg[XFS_ERR_CLASS_MAX][XFS_ERR_ERRNO_MAX];
150 struct xstats m_stats; /* per-fs stats */ 153 struct xstats m_stats; /* per-fs stats */
151 154
diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
index 74e394071242..07c95999541e 100644
--- a/fs/xfs/xfs_sysfs.c
+++ b/fs/xfs/xfs_sysfs.c
@@ -399,11 +399,34 @@ int
399xfs_error_sysfs_init( 399xfs_error_sysfs_init(
400 struct xfs_mount *mp) 400 struct xfs_mount *mp)
401{ 401{
402 struct xfs_error_cfg *cfg;
402 int error; 403 int error;
403 404
404 /* .../xfs/<dev>/error/ */ 405 /* .../xfs/<dev>/error/ */
405 error = xfs_sysfs_init(&mp->m_error_kobj, &xfs_error_ktype, 406 error = xfs_sysfs_init(&mp->m_error_kobj, &xfs_error_ktype,
406 &mp->m_kobj, "error"); 407 &mp->m_kobj, "error");
408 if (error)
409 return error;
410
411 /* .../xfs/<dev>/error/metadata/ */
412 error = xfs_sysfs_init(&mp->m_error_meta_kobj, &xfs_error_ktype,
413 &mp->m_error_kobj, "metadata");
414 if (error)
415 goto out_error;
416
417 cfg = &mp->m_error_cfg[XFS_ERR_METADATA][XFS_ERR_DEFAULT];
418 error = xfs_sysfs_init(&cfg->kobj, &xfs_error_cfg_ktype,
419 &mp->m_error_meta_kobj, "default");
420 if (error)
421 goto out_error_meta;
422 cfg->max_retries = -1;
423
424 return 0;
425
426out_error_meta:
427 xfs_sysfs_del(&mp->m_error_meta_kobj);
428out_error:
429 xfs_sysfs_del(&mp->m_error_kobj);
407 return error; 430 return error;
408} 431}
409 432
@@ -411,5 +434,16 @@ void
411xfs_error_sysfs_del( 434xfs_error_sysfs_del(
412 struct xfs_mount *mp) 435 struct xfs_mount *mp)
413{ 436{
437 struct xfs_error_cfg *cfg;
438 int i, j;
439
440 for (i = 0; i < XFS_ERR_CLASS_MAX; i++) {
441 for (j = 0; j < XFS_ERR_ERRNO_MAX; j++) {
442 cfg = &mp->m_error_cfg[i][j];
443
444 xfs_sysfs_del(&cfg->kobj);
445 }
446 }
447 xfs_sysfs_del(&mp->m_error_meta_kobj);
414 xfs_sysfs_del(&mp->m_error_kobj); 448 xfs_sysfs_del(&mp->m_error_kobj);
415} 449}