aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/ztest
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/ztest')
-rw-r--r--cmd/ztest/ztest.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c
index 111d45b9d..0d9495a28 100644
--- a/cmd/ztest/ztest.c
+++ b/cmd/ztest/ztest.c
@@ -2674,6 +2674,13 @@ ztest_zil_remount(ztest_ds_t *zd, uint64_t id)
objset_t *os = zd->zd_os;
/*
+ * We hold the ztest_vdev_lock so we don't cause problems with
+ * other threads that wish to remove a log device, such as
+ * ztest_device_removal().
+ */
+ mutex_enter(&ztest_vdev_lock);
+
+ /*
* We grab the zd_dirobj_lock to ensure that no other thread is
* updating the zil (i.e. adding in-memory log records) and the
* zd_zilog_lock to block any I/O.
@@ -2690,6 +2697,7 @@ ztest_zil_remount(ztest_ds_t *zd, uint64_t id)
(void) pthread_rwlock_unlock(&zd->zd_zilog_lock);
mutex_exit(&zd->zd_dirobj_lock);
+ mutex_exit(&ztest_vdev_lock);
}
/*