Skip to content

Commit

Permalink
zio: do no-op injections just before handing off to vdevs
Browse files Browse the repository at this point in the history
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.
Signed-off-by: Rob Norris <[email protected]>
  • Loading branch information
robn committed Feb 5, 2025
1 parent 2ca91ba commit 5e3184a
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions module/zfs/zio.c
Original file line number Diff line number Diff line change
Expand Up @@ -4422,16 +4422,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);

Expand All @@ -4441,6 +4431,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_interrupt(zio);
return (NULL);
}
}

vd->vdev_ops->vdev_op_io_start(zio);
Expand Down

0 comments on commit 5e3184a

Please sign in to comment.