"\t\tspa_vdev_exit() will trigger a panic.\n"
"\n"
"\tzinject -d device [-e errno] [-L <nvlist|uber|pad1|pad2>] [-F]\n"
- "\t\t[-T <read|write|free|claim|all>] [-f frequency] pool\n\n"
+ "\t\t[-T <read|write|free|claim|ioctl|all>] [-f frequency] pool\n\n"
"\t\tInject a fault into a particular device or the device's\n"
"\t\tlabel. Label injection can either be 'nvlist', 'uber',\n "
"\t\t'pad1', or 'pad2'.\n"
io_type = ZIO_TYPE_FREE;
} else if (strcasecmp(optarg, "claim") == 0) {
io_type = ZIO_TYPE_CLAIM;
+ } else if (strcasecmp(optarg, "ioctl") == 0) {
+ io_type = ZIO_TYPE_IOCTL;
} else if (strcasecmp(optarg, "all") == 0) {
io_type = ZIO_TYPES;
} else {
(void) fprintf(stderr, "invalid I/O type "
"'%s': must be 'read', 'write', 'free', "
- "'claim' or 'all'\n", optarg);
+ "'claim', 'ioctl' or 'all'\n", optarg);
usage();
libzfs_fini(g_zfs);
return (1);
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----- */
#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 | \
.\" CDDL HEADER END
.\"
.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
+.\" Copyright (c) 2024, Klara Inc.
.\"
.\" lint-ok: WARNING: sections out of conventional order: Sh SYNOPSIS
.\"
-.Dd May 26, 2021
+.Dd April 4, 2024
.Dt ZINJECT 8
.Os
.
.It Fl T Ar failure
Set the failure type to one of
.Sy all ,
+.Sy ioctl ,
.Sy claim ,
.Sy free ,
.Sy read ,
ZIO_STAGE_READY:0x00100000:RWFCIT
ZIO_STAGE_VDEV_IO_START:0x00200000:RW--IT
-ZIO_STAGE_VDEV_IO_DONE:0x00400000:RW---T
+ZIO_STAGE_VDEV_IO_DONE:0x00400000:RW--IT
ZIO_STAGE_VDEV_IO_ASSESS:0x00800000:RW--IT
ZIO_STAGE_CHECKSUM_VERIFY:0x01000000:R-----
}
ASSERT(zio->io_type == ZIO_TYPE_READ ||
- zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_TRIM);
+ zio->io_type == ZIO_TYPE_WRITE ||
+ zio->io_type == ZIO_TYPE_IOCTL ||
+ zio->io_type == ZIO_TYPE_TRIM);
if (zio->io_delay)
zio->io_delay = gethrtime() - zio->io_delay;
if (vd != NULL && vd->vdev_ops->vdev_op_leaf &&
vd->vdev_ops != &vdev_draid_spare_ops) {
- vdev_queue_io_done(zio);
+ if (zio->io_type != ZIO_TYPE_IOCTL)
+ vdev_queue_io_done(zio);
if (zio_injection_enabled && zio->io_error == 0)
zio->io_error = zio_handle_device_injections(vd, zio,
int ret = 0;
/*
- * We skip over faults in the labels unless it's during
- * device open (i.e. zio == NULL).
+ * We skip over faults in the labels unless it's during device open
+ * (i.e. zio == NULL) or a device flush (offset is meaningless)
*/
- if (zio != NULL) {
+ if (zio != NULL && zio->io_type != ZIO_TYPE_IOCTL) {
uint64_t offset = zio->io_offset;
if (offset < VDEV_LABEL_START_SIZE ||