mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zinject: "no-op" error injection
When injected, this causes the matching IO to appear to succeed, but the actual work is never submitted to the physical device. This can be used to simulate a write-back cache servicing a write, but the backing device has failed and the cache cannot complete the operation in the background. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #16085
This commit is contained in:
@@ -4058,6 +4058,16 @@ 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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user