zinject: add "probe" device injection type

Injecting a device probe failure is not possible by matching IO types,
because probe IO goes to the label regions, which is explicitly excluded
from injection. Even if it were possible, it would be awkward to do,
because a probe is sequence of reads and writes.

This commit adds a new IO "type" to match for injection, which looks for
the ZIO_FLAG_PROBE flag instead. Any probe IO will be match the
injection record and recieve the wanted error.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16947
This commit is contained in:
Rob Norris
2025-01-08 17:14:33 +11:00
committed by Ameer Hamza
parent 0dfcfe023e
commit a28f5a94f4
7 changed files with 100 additions and 15 deletions
+12 -11
View File
@@ -19,11 +19,11 @@
.\" CDDL HEADER END
.\"
.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
.\" Copyright (c) 2024, Klara Inc.
.\" Copyright (c) 2024, 2025, Klara, Inc.
.\"
.\" lint-ok: WARNING: sections out of conventional order: Sh SYNOPSIS
.\"
.Dd December 2, 2024
.Dd January 14, 2025
.Dt ZINJECT 8
.Os
.
@@ -265,15 +265,16 @@ will be translated to the appropriate blkid range according to the
object's properties.
.It Fl s Ar seconds
Run for this many seconds before reporting failure.
.It Fl T Ar failure
Set the failure type to one of
.Sy all ,
.Sy flush ,
.Sy claim ,
.Sy free ,
.Sy read ,
or
.Sy write .
.It Fl T Ar type
Inject the error into I/O of this type.
.Bl -tag -compact -width "read, write, flush, claim, free"
.It Sy read , Sy write , Sy flush , Sy claim , Sy free
Fundamental I/O types
.It Sy all
All fundamental I/O types
.It Sy probe
Device probe I/O
.El
.It Fl t Ar mos_type
Set this to
.Bl -tag -compact -width "spacemap"