From b14cefa6680805b4ae569c316dcd38bdfcfd9beb Mon Sep 17 00:00:00 2001 From: Fedor Uporov Date: Fri, 13 Oct 2023 05:49:33 -0700 Subject: [PATCH] Fix raidz_003/004_pos.ksh kill after timeout expiration --- cmd/raidz_test/raidz_test.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/raidz_test/raidz_test.c b/cmd/raidz_test/raidz_test.c index 6a018ecf0737..f6d8b50ea8e4 100644 --- a/cmd/raidz_test/raidz_test.c +++ b/cmd/raidz_test/raidz_test.c @@ -769,6 +769,14 @@ run_sweep(void) VERIFY(free_slots <= max_free_slots); while (free_slots < max_free_slots) { (void) cv_wait(&sem_cv, &sem_mtx); + + /* check if should stop the test (timeout) */ + time_diff = (gethrtime() - start_time) / NANOSEC + if (rto_opts.rto_sweep_timeout > 0 && + time_diff >= rto_opts.rto_sweep_timeout) { + sweep_state = SWEEP_TIMEOUT; + rto_opts.rto_should_stop = B_TRUE; + } } mutex_exit(&sem_mtx);