From cb8709e34fdf70a04b64f8d6b0b3cdeee571332d Mon Sep 17 00:00:00 2001 From: Don Brady Date: Tue, 27 Feb 2024 15:36:21 +0000 Subject: [PATCH] Clear injector when delay already occurred Signed-off-by: Don Brady --- module/zfs/zio_inject.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/zfs/zio_inject.c b/module/zfs/zio_inject.c index 6e5301ab9c9a..387655d7b460 100644 --- a/module/zfs/zio_inject.c +++ b/module/zfs/zio_inject.c @@ -719,8 +719,8 @@ zio_handle_pool_delay(spa_t *spa, hrtime_t elapsed, zinject_type_t command) SEC2NSEC(handler->zi_record.zi_duration); if (pause > elapsed) { delay = pause - elapsed; - id = handler->zi_id; } + id = handler->zi_id; break; } } @@ -733,6 +733,8 @@ zio_handle_pool_delay(spa_t *spa, hrtime_t elapsed, zinject_type_t command) "sec delay", (u_longlong_t)NSEC2SEC(delay)); } zfs_sleep_until(gethrtime() + delay); + } + if (id) { /* all done with this one-shot handler */ zio_clear_fault(id); }