Skip to content

RFC xfs: configurable error behaviours

Dave Chinner linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest10 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10xfs: remove XBF_DONE flag wrapper macrosfs/xfs/xfs_buf.c fs/xfs/xfs_buf.h fs/xfs/xfs_buf_item.c +5 more+11 -150 replies
2/10xfs: configurable error behaviour via sysfsfs/xfs/xfs_mount.c fs/xfs/xfs_mount.h fs/xfs/xfs_sysfs.c +1 more+123 -20 replies
3/10xfs: introduce metadata IO error classfs/xfs/xfs_mount.h fs/xfs/xfs_sysfs.c+37 -00 replies
4/10xfs: add configurable error support to metadata buffersfs/xfs/xfs_buf.h fs/xfs/xfs_buf_item.c fs/xfs/xfs_mount.h +1 more+88 -451 reply
5/10xfs: introduce table-based init for error behavioursfs/xfs/xfs_sysfs.c+60 -121 reply
6/10xfs: add configuration of error failure speedfs/xfs/xfs_buf.h fs/xfs/xfs_buf_item.c fs/xfs/xfs_mount.h +1 more+164 -21 reply
7/10xfs: add "fail at unmount" error handling configurationfs/xfs/xfs_buf_item.c fs/xfs/xfs_mount.c fs/xfs/xfs_mount.h +1 more+51 -00 replies
8/10xfs: add configuration handles for specific errorsfs/xfs/xfs_mount.h fs/xfs/xfs_sysfs.c+27 -00 replies
9/10xfs: disable specific error configurationsfs/xfs/xfs_mount.h fs/xfs/xfs_sysfs.c+19 -40 replies
10/10xfs: add kmem error configuration classfs/xfs/xfs_mount.h fs/xfs/xfs_sysfs.c+61 -190 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC, PATCH 00/10] xfs: configurable error behaviours

Hi folks,

This is my first pass at introducing a framework for configuring the error handling behaviour of various subsystems in XFS. This is being driven by the need to handle things like ENOSPC from thin provisioned block devices in a sane manner, as well as from the mm/ side of the kernel for more configurable memory allocation failure behaviour.

The patchset introduces the concepts of:

- "failure speed", which defines the obvious behaviour of the error handlers. "fast" will fail immediately, "slow" will fail after a bound number of retries or timeout, and "never" means exactly that. The current behaviour is "never", and this patchset mostly leaves the default behaviour configured this way.

- "error class", which is the subsystem or error location the error handlers configure the behaviour for. "metadata" configures async write errors in metadata buffers, "kmem" configures memory allocation failure behaviour and we'll add others as we see fit.

- "error handler", which is the specific error the configuration applies to. For IO errors, it's obvious that EIO, ENOSPC, ENODEV, etc are errors that need to be handled in different ways. But for the kmem class, the only error is ENOMEM, so while that it is currently configured that way, the error handlers are more likely to refer to failures in transaction context, in buffer allocation context, etc. IOWs, the name and failure context can change, but the same "failure speed" definition still applies.

As a result, the infrastructure is quite flexible - anywhere you have a struct xfs_mount you can look up an error handling configuration and apply it appropriately for that context. The patchset really only implements a metadata buffer async write IO error context handler, but that is just the tip of the iceberg....

I've tried to make the initialisation as generic and simple as possible. It's all table based, so all the default values are in one place and easy to find - you don't have to touch the initialisation code to modify the default error config, or to add new errors. Only sysfs handlers need to be added for new error classes and handlers.

The current sysfs layout looks like this:

$ find /sys/fs/xfs/vdc/error
/sys/fs/xfs/vdc/error
/sys/fs/xfs/vdc/error/kmem
/sys/fs/xfs/vdc/error/kmem/ENOMEM
/sys/fs/xfs/vdc/error/kmem/ENOMEM/max_retries
/sys/fs/xfs/vdc/error/kmem/ENOMEM/failure_speed
/sys/fs/xfs/vdc/error/kmem/ENOMEM/fail_at_unmount
/sys/fs/xfs/vdc/error/kmem/ENOMEM/retry_timeout_seconds
/sys/fs/xfs/vdc/error/kmem/Default
/sys/fs/xfs/vdc/error/kmem/Default/max_retries
/sys/fs/xfs/vdc/error/kmem/Default/failure_speed
/sys/fs/xfs/vdc/error/kmem/Default/fail_at_unmount
/sys/fs/xfs/vdc/error/kmem/Default/retry_timeout_seconds
/sys/fs/xfs/vdc/error/metadata
/sys/fs/xfs/vdc/error/metadata/EIO
/sys/fs/xfs/vdc/error/metadata/EIO/max_retries
/sys/fs/xfs/vdc/error/metadata/EIO/failure_speed
/sys/fs/xfs/vdc/error/metadata/EIO/fail_at_unmount
/sys/fs/xfs/vdc/error/metadata/EIO/retry_timeout_seconds
/sys/fs/xfs/vdc/error/metadata/ENODEV
/sys/fs/xfs/vdc/error/metadata/ENODEV/max_retries
/sys/fs/xfs/vdc/error/metadata/ENODEV/failure_speed
/sys/fs/xfs/vdc/error/metadata/ENODEV/fail_at_unmount
/sys/fs/xfs/vdc/error/metadata/ENODEV/retry_timeout_seconds
/sys/fs/xfs/vdc/error/metadata/ENOSPC
/sys/fs/xfs/vdc/error/metadata/ENOSPC/max_retries
/sys/fs/xfs/vdc/error/metadata/ENOSPC/failure_speed
/sys/fs/xfs/vdc/error/metadata/ENOSPC/fail_at_unmount
/sys/fs/xfs/vdc/error/metadata/ENOSPC/retry_timeout_seconds
/sys/fs/xfs/vdc/error/metadata/Default
/sys/fs/xfs/vdc/error/metadata/Default/max_retries
/sys/fs/xfs/vdc/error/metadata/Default/failure_speed
/sys/fs/xfs/vdc/error/metadata/Default/fail_at_unmount
/sys/fs/xfs/vdc/error/metadata/Default/retry_timeout_seconds
$

Which shows the classes and error handlers, and how different classes can have different error handlers.

The patchset runs through xfstests without problems on the default configuration it sets. Note that the default config for the metadata class now sets "fail at unmount" so errors that have been retries indefinitely will fail at unmount and trigger a shutdown at that point. This is preferable to hanging unmount as currently happens.

Anyway, have a play, have a poke, and let me know what you think...

Cheers,

Dave.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs