From: Dave Chinner <david@fromorbit.com>
To: xfs@oss.sgi.com
Subject: [PATCH 03/10] xfs: introduce metadata IO error class
Date: Wed, 5 Aug 2015 21:08:34 +1000 [thread overview]
Message-ID: <1438772921-28715-4-git-send-email-david@fromorbit.com> (raw)
In-Reply-To: <1438772921-28715-1-git-send-email-david@fromorbit.com>
From: Dave Chinner <dchinner@redhat.com>
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 behaviour of
XFS_ERR_FAIL_NEVER for async write metadata buffers.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
fs/xfs/xfs_mount.h | 3 +++
fs/xfs/xfs_sysfs.c | 34 ++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index e51c63c..753060f 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -45,9 +45,11 @@ enum {
* Failure types describe when an error is considered fatal.
*/
enum {
+ XFS_ERR_METADATA,
XFS_ERR_CLASS_MAX,
};
enum {
+ XFS_ERR_DEFAULT,
XFS_ERR_ERRNO_MAX,
};
enum {
@@ -153,6 +155,7 @@ typedef struct xfs_mount {
/* low free space thresholds */
struct xfs_kobj m_kobj;
struct xfs_kobj m_error_kobj;
+ struct xfs_kobj m_error_meta_kobj;
struct xfs_error_cfg m_error_cfg[XFS_ERR_CLASS_MAX][XFS_ERR_ERRNO_MAX];
struct workqueue_struct *m_buf_workqueue;
diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
index 017dcfb..cb7ced0 100644
--- a/fs/xfs/xfs_sysfs.c
+++ b/fs/xfs/xfs_sysfs.c
@@ -307,11 +307,34 @@ int
xfs_error_sysfs_init(
struct xfs_mount *mp)
{
+ struct xfs_error_cfg *cfg;
int error;
/* .../xfs/<dev>/error/ */
error = xfs_sysfs_init(&mp->m_error_kobj, &xfs_error_ktype,
&mp->m_kobj, "error");
+ if (error)
+ return error;
+
+ /* .../xfs/<dev>/error/metadata/ */
+ error = xfs_sysfs_init(&mp->m_error_meta_kobj, &xfs_error_ktype,
+ &mp->m_error_kobj, "metadata");
+ if (error)
+ goto out_error;
+
+ cfg = &mp->m_error_cfg[XFS_ERR_METADATA][XFS_ERR_DEFAULT];
+ error = xfs_sysfs_init(&cfg->kobj, &xfs_error_cfg_ktype,
+ &mp->m_error_meta_kobj, "Default");
+ if (error)
+ goto out_error_meta;
+ cfg->fail_speed = XFS_ERR_FAIL_NEVER;
+
+ return 0;
+
+out_error_meta:
+ xfs_sysfs_del(&mp->m_error_meta_kobj);
+out_error:
+ xfs_sysfs_del(&mp->m_error_kobj);
return error;
}
@@ -319,5 +342,16 @@ void
xfs_error_sysfs_del(
struct xfs_mount *mp)
{
+ struct xfs_error_cfg *cfg;
+ int i, j;
+
+ for (i = 0; i < XFS_ERR_CLASS_MAX; i++) {
+ for (j = 0; j < XFS_ERR_ERRNO_MAX; j++) {
+ cfg = &mp->m_error_cfg[i][j];
+
+ xfs_sysfs_del(&cfg->kobj);
+ }
+ }
+ xfs_sysfs_del(&mp->m_error_meta_kobj);
xfs_sysfs_del(&mp->m_error_kobj);
}
--
2.1.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2015-08-05 11:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-05 11:08 [RFC, PATCH 00/10] xfs: configurable error behaviours Dave Chinner
2015-08-05 11:08 ` [PATCH 01/10] xfs: remove XBF_DONE flag wrapper macros Dave Chinner
2015-08-05 11:08 ` [PATCH 02/10] xfs: configurable error behaviour via sysfs Dave Chinner
2015-08-05 11:08 ` Dave Chinner [this message]
2015-08-05 11:08 ` [PATCH 04/10] xfs: add configurable error support to metadata buffers Dave Chinner
2015-08-11 14:18 ` Brian Foster
2015-08-05 11:08 ` [PATCH 05/10] xfs: introduce table-based init for error behaviours Dave Chinner
2015-08-11 14:19 ` Brian Foster
2015-08-05 11:08 ` [PATCH 06/10] xfs: add configuration of error failure speed Dave Chinner
2015-08-11 14:19 ` Brian Foster
2015-08-05 11:08 ` [PATCH 07/10] xfs: add "fail at unmount" error handling configuration Dave Chinner
2015-08-05 11:08 ` [PATCH 08/10] xfs: add configuration handles for specific errors Dave Chinner
2015-08-05 11:08 ` [PATCH 09/10] xfs: disable specific error configurations Dave Chinner
2015-08-05 11:08 ` [PATCH 10/10] xfs: add kmem error configuration class Dave Chinner
2015-08-11 14:20 ` [RFC, PATCH 00/10] xfs: configurable error behaviours Brian Foster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1438772921-28715-4-git-send-email-david@fromorbit.com \
--to=david@fromorbit.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox