zinject: inject device errors into ioctls

Adds 'ioctl' as a valid IO type for device error injection, so we can
simulate a flush error (which OpenZFS currently ignores, but that's by
the by).

To support this, adding ZIO_STAGE_VDEV_IO_DONE to ZIO_IOCTL_PIPELINE,
since that's where device error injection happens. This needs a small
exclusion to avoid the vdev_queue, since flushes are not queued, and I'm
assuming that the various failure responses are still reasonable for
flush failures (probes, media change, etc). This seems reasonable to me,
as a flush failure is not unlike a write failure in this regard, however
this may be too aggressive or subtle to assume in just this change.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16061
This commit is contained in:
Rob N
2024-04-09 04:59:04 +10:00
committed by GitHub
parent ba9f587a77
commit 76d1dde94c
6 changed files with 18 additions and 12 deletions
+2 -3
View File
@@ -153,7 +153,7 @@ enum zio_stage {
ZIO_STAGE_READY = 1 << 20, /* RWFCIT */
ZIO_STAGE_VDEV_IO_START = 1 << 21, /* RW--IT */
ZIO_STAGE_VDEV_IO_DONE = 1 << 22, /* RW---T */
ZIO_STAGE_VDEV_IO_DONE = 1 << 22, /* RW--IT */
ZIO_STAGE_VDEV_IO_ASSESS = 1 << 23, /* RW--IT */
ZIO_STAGE_CHECKSUM_VERIFY = 1 << 24, /* R----- */
@@ -261,8 +261,7 @@ enum zio_stage {
#define ZIO_IOCTL_PIPELINE \
(ZIO_INTERLOCK_STAGES | \
ZIO_STAGE_VDEV_IO_START | \
ZIO_STAGE_VDEV_IO_ASSESS)
ZIO_VDEV_IO_STAGES)
#define ZIO_TRIM_PIPELINE \
(ZIO_INTERLOCK_STAGES | \