Skip to content

Commit b8c73ab

Browse files
authored
zio: do no-op injections just before handing off to vdevs
The purpose of no-op is to simulate a failure between a device cache and its permanent store. We still want it to go through the queue and respond in the same way to everything else. So, inject "success" as the very last thing, and then move on to VDEV_IO_DONE to be dequeued and so any followup work can occur. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #17029
1 parent d2147de commit b8c73ab

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

module/zfs/zio.c

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4495,16 +4495,6 @@ zio_vdev_io_start(zio_t *zio)
44954495
zio->io_type == ZIO_TYPE_WRITE ||
44964496
zio->io_type == ZIO_TYPE_TRIM)) {
44974497

4498-
if (zio_handle_device_injection(vd, zio, ENOSYS) != 0) {
4499-
/*
4500-
* "no-op" injections return success, but do no actual
4501-
* work. Just skip the remaining vdev stages.
4502-
*/
4503-
zio_vdev_io_bypass(zio);
4504-
zio_interrupt(zio);
4505-
return (NULL);
4506-
}
4507-
45084498
if ((zio = vdev_queue_io(zio)) == NULL)
45094499
return (NULL);
45104500

@@ -4514,6 +4504,15 @@ zio_vdev_io_start(zio_t *zio)
45144504
return (NULL);
45154505
}
45164506
zio->io_delay = gethrtime();
4507+
4508+
if (zio_handle_device_injection(vd, zio, ENOSYS) != 0) {
4509+
/*
4510+
* "no-op" injections return success, but do no actual
4511+
* work. Just return it.
4512+
*/
4513+
zio_delay_interrupt(zio);
4514+
return (NULL);
4515+
}
45174516
}
45184517

45194518
vd->vdev_ops->vdev_op_io_start(zio);

0 commit comments

Comments
 (0)