zio: Avoid sleeping in the I/O path
commitd76d79fd2784fb8a09edc6a9879b927d2745b6ff
authorMark Johnston <markjdb@gmail.com>
Wed, 20 Nov 2024 16:23:08 +0000 (20 11:23 -0500)
committerGitHub <noreply@github.com>
Wed, 20 Nov 2024 16:23:08 +0000 (20 08:23 -0800)
tree604fa81aa4037209557eb4b35e840ce15998bf19
parent457f8b76e76836b617b1268abeb8e449f00288cc
zio: Avoid sleeping in the I/O path

zio_delay_interrupt(), apparently used for fault injection, is executed
in the I/O pipeline.  It can cause the calling thread to go to sleep,
which is not allowed on FreeBSD.  This happens only for small delays,
though, and there's no apparent reason to avoid deferring to a taskqueue
in that case, as it already does otherwise.

Simply go to sleep unconditionally.  This fixes an occasional panic I
see when running the ZTS on FreeBSD.  Also remove an unhelpful comment
referencing the non-existent timeout_generic().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Mark Johnston <markj@FreeBSD.org>
Closes #16785
module/zfs/zio.c