From: Brian Foster <bfoster@redhat.com>
To: Carlos Maiolino <cmaiolino@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/7] xfs: configurable error behavior via sysfs
Date: Thu, 5 May 2016 10:10:26 -0400 [thread overview]
Message-ID: <20160505141026.GA1231@bfoster.bfoster> (raw)
In-Reply-To: <1462376600-8617-2-git-send-email-cmaiolino@redhat.com>
On Wed, May 04, 2016 at 05:43:14PM +0200, Carlos Maiolino wrote:
> We need to be able to change the way XFS behaviours in error
> conditions depending on the type of underlying storage. This is
> necessary for handling non-traditional block devices with extended
> error cases, such as thin provisioned devices that can return ENOSPC
> as an IO error.
>
> Introduce the basic sysfs infrastructure needed to define and
> configure error behaviours. This is done to be generic enough to
> extend to configuring behaviour in other error conditions, such as
> ENOMEM, which also has different desired behaviours according to
> machine configuration.
>
> Changelog:
>
> V3:
> - Rebase patch on top of linux-xfs tree
> - Remove XFS_ERR_FAIL enums, once we are not using them
> to control the fail speed, but base it on max_retries value
> - Get rid of xfs_error_cfg.fail_speed field. We will use only
> .max_retries to control the failure speed for each error
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
> ---
> fs/xfs/xfs_mount.c | 10 +++++++++-
> fs/xfs/xfs_mount.h | 20 ++++++++++++++++++++
> fs/xfs/xfs_sysfs.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
> fs/xfs/xfs_sysfs.h | 3 +++
> 4 files changed, 84 insertions(+), 2 deletions(-)
>
...
> diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
> index 6ced4f1..b971113 100644
> --- a/fs/xfs/xfs_sysfs.c
> +++ b/fs/xfs/xfs_sysfs.c
> @@ -17,10 +17,11 @@
> */
>
> #include "xfs.h"
> -#include "xfs_sysfs.h"
> +#include "xfs_shared.h"
> #include "xfs_format.h"
> #include "xfs_log_format.h"
> #include "xfs_trans_resv.h"
> +#include "xfs_sysfs.h"
> #include "xfs_log.h"
> #include "xfs_log_priv.h"
> #include "xfs_stats.h"
> @@ -362,3 +363,53 @@ struct kobj_type xfs_log_ktype = {
> .sysfs_ops = &xfs_sysfs_ops,
> .default_attrs = xfs_log_attrs,
> };
> +
> +/*
> + * Metadata IO error configuration
> + *
> + * The sysfs structure here is:
> + * ...xfs/<dev>/error/<class>/<errno>/<error_attrs>
> + *
> + * where <class> allows use to discriminate between data IO and metadata IO,
Spelling: us
Otherwise looks fine:
Reviewed-by: Brian Foster <bfoster@redhat.com>
> + * and any other future type of IO (e.g. special inode or directory error
> + * handling) we care to support.
> + */
> +static struct attribute *xfs_error_attrs[] = {
> + NULL,
> +};
> +
> +static inline struct xfs_error_cfg *
> +to_error_cfg(struct kobject *kobject)
> +{
> + struct xfs_kobj *kobj = to_kobj(kobject);
> + return container_of(kobj, struct xfs_error_cfg, kobj);
> +}
> +
> +struct kobj_type xfs_error_cfg_ktype = {
> + .release = xfs_sysfs_release,
> + .sysfs_ops = &xfs_sysfs_ops,
> + .default_attrs = xfs_error_attrs,
> +};
> +
> +struct kobj_type xfs_error_ktype = {
> + .release = xfs_sysfs_release,
> +};
> +
> +int
> +xfs_error_sysfs_init(
> + struct xfs_mount *mp)
> +{
> + int error;
> +
> + /* .../xfs/<dev>/error/ */
> + error = xfs_sysfs_init(&mp->m_error_kobj, &xfs_error_ktype,
> + &mp->m_kobj, "error");
> + return error;
> +}
> +
> +void
> +xfs_error_sysfs_del(
> + struct xfs_mount *mp)
> +{
> + xfs_sysfs_del(&mp->m_error_kobj);
> +}
> diff --git a/fs/xfs/xfs_sysfs.h b/fs/xfs/xfs_sysfs.h
> index be692e5..d046371 100644
> --- a/fs/xfs/xfs_sysfs.h
> +++ b/fs/xfs/xfs_sysfs.h
> @@ -58,4 +58,7 @@ xfs_sysfs_del(
> wait_for_completion(&kobj->complete);
> }
>
> +int xfs_error_sysfs_init(struct xfs_mount *mp);
> +void xfs_error_sysfs_del(struct xfs_mount *mp);
> +
> #endif /* __XFS_SYSFS_H__ */
> --
> 2.4.11
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2016-05-05 14:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-04 15:43 [PATCH 0/7] Configurable error behavior [V3] Carlos Maiolino
2016-05-04 15:43 ` [PATCH 1/7] xfs: configurable error behavior via sysfs Carlos Maiolino
2016-05-05 14:10 ` Brian Foster [this message]
2016-05-04 15:43 ` [PATCH 2/7] xfs: introduce metadata IO error class Carlos Maiolino
2016-05-05 14:10 ` Brian Foster
2016-05-04 15:43 ` [PATCH 3/7] xfs: add configurable error support to metadata buffers Carlos Maiolino
2016-05-05 14:10 ` Brian Foster
2016-05-04 15:43 ` [PATCH 4/7] xfs: introduce table-based init for error behaviors Carlos Maiolino
2016-05-05 14:10 ` Brian Foster
2016-05-04 15:43 ` [PATCH 5/7] xfs: add configuration of error failure speed Carlos Maiolino
2016-05-05 14:10 ` Brian Foster
2016-05-06 0:04 ` Dave Chinner
2016-05-06 10:59 ` Carlos Maiolino
2016-05-04 15:43 ` [PATCH 6/7] xfs: add configuration handlers for specific errors Carlos Maiolino
2016-05-05 14:11 ` Brian Foster
2016-05-05 23:57 ` Dave Chinner
2016-05-04 15:43 ` [PATCH 7/7] xfs: add "fail at unmount" error handling configuration Carlos Maiolino
2016-05-05 14:11 ` [PATCH 0/7] Configurable error behavior [V3] Brian Foster
2016-05-05 14:37 ` Carlos Maiolino
2016-05-05 15:18 ` Brian Foster
2016-05-05 23:49 ` Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2016-05-10 12:16 [PATCH 0/7] Configurable error behavior [V4] Carlos Maiolino
2016-05-10 12:16 ` [PATCH 1/7] xfs: configurable error behavior via sysfs Carlos Maiolino
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=20160505141026.GA1231@bfoster.bfoster \
--to=bfoster@redhat.com \
--cc=cmaiolino@redhat.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