diff --git a/module/zfs/zio.c b/module/zfs/zio.c index 10930e7f3..b071ac17e 100644 --- a/module/zfs/zio.c +++ b/module/zfs/zio.c @@ -4495,16 +4495,6 @@ zio_vdev_io_start(zio_t *zio) zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_TRIM)) { - if (zio_handle_device_injection(vd, zio, ENOSYS) != 0) { - /* - * "no-op" injections return success, but do no actual - * work. Just skip the remaining vdev stages. - */ - zio_vdev_io_bypass(zio); - zio_interrupt(zio); - return (NULL); - } - if ((zio = vdev_queue_io(zio)) == NULL) return (NULL); @@ -4514,6 +4504,15 @@ zio_vdev_io_start(zio_t *zio) return (NULL); } zio->io_delay = gethrtime(); + + if (zio_handle_device_injection(vd, zio, ENOSYS) != 0) { + /* + * "no-op" injections return success, but do no actual + * work. Just return it. + */ + zio_delay_interrupt(zio); + return (NULL); + } } vd->vdev_ops->vdev_op_io_start(zio);