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
+2 -1
View File
@@ -471,7 +471,8 @@ typedef enum zinject_iotype {
ZINJECT_IOTYPE_TRIM = ZIO_TYPE_TRIM,
ZINJECT_IOTYPE_ALL = ZIO_TYPES,
/* Room for future expansion for ZIO_TYPE_* */
ZINJECT_IOTYPES = 16,
ZINJECT_IOTYPE_PROBE = 16,
ZINJECT_IOTYPES,
} zinject_iotype_t;
typedef struct zfs_share {