Skip to content

Commit a9ca834

Browse files
committed
vdev_geom: converted injected EIO errors to ENXIO
By the assertion, vdev_geom_io_done() only expects ENXIO on an error when the geom is a top-level (allocating) vdev[1][2]. However, zinject currently can't insert ENXIO directly, possibly because on Solaris outright disk failures were reported with EIO[2][3]. This is a narrow workaround to convert EIO to ENXIO when injections are enabled, to avoid the assertion and allow the test suite to test behaviour related to probe failure on FreeBSD. 1. freebsd/freebsd-src@37ec52ca7a2a 2. freebsd/freebsd-src@cd730bd6b2b1 3. illumos/illumos-gate@ea8dc4b6d2 Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Rob Norris <[email protected]>
1 parent c2201d3 commit a9ca834

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

module/os/freebsd/zfs/vdev_geom.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,16 @@ vdev_geom_io_done(zio_t *zio)
12411241
}
12421242

12431243
if (bp == NULL) {
1244-
ASSERT3S(zio->io_error, ==, ENXIO);
1244+
if (zio_injection_enabled && zio->io_error == EIO)
1245+
/*
1246+
* Convert an injected EIO to ENXIO. This is needed to
1247+
* work around zio_handle_device_injection_impl() not
1248+
* currently being able to inject ENXIO directly, while
1249+
* the assertion below only allows ENXIO here.
1250+
*/
1251+
zio->io_error = SET_ERROR(ENXIO);
1252+
else
1253+
ASSERT3S(zio->io_error, ==, ENXIO);
12451254
return;
12461255
}
12471256

0 commit comments

Comments
 (0)