diff --git a/module/zfs/mmp.c b/module/zfs/mmp.c index 3b74a6b618..7523310cd7 100644 --- a/module/zfs/mmp.c +++ b/module/zfs/mmp.c @@ -607,7 +607,8 @@ param_set_multihost_interval(const char *val, zfs_kernel_param_t *kp) if (ret < 0) return (ret); - mmp_signal_all_threads(); + if (spa_mode_global != 0) + mmp_signal_all_threads(); return (ret); } diff --git a/module/zfs/vdev_disk.c b/module/zfs/vdev_disk.c index d62128353c..6761e755a7 100644 --- a/module/zfs/vdev_disk.c +++ b/module/zfs/vdev_disk.c @@ -815,19 +815,21 @@ param_set_vdev_scheduler(const char *val, zfs_kernel_param_t *kp) if ((p = strchr(val, '\n')) != NULL) *p = '\0'; - mutex_enter(&spa_namespace_lock); - while ((spa = spa_next(spa)) != NULL) { - if (spa_state(spa) != POOL_STATE_ACTIVE || - !spa_writeable(spa) || spa_suspended(spa)) - continue; - - spa_open_ref(spa, FTAG); - mutex_exit(&spa_namespace_lock); - vdev_elevator_switch(spa->spa_root_vdev, (char *)val); + if (spa_mode_global != 0) { mutex_enter(&spa_namespace_lock); - spa_close(spa, FTAG); + while ((spa = spa_next(spa)) != NULL) { + if (spa_state(spa) != POOL_STATE_ACTIVE || + !spa_writeable(spa) || spa_suspended(spa)) + continue; + + spa_open_ref(spa, FTAG); + mutex_exit(&spa_namespace_lock); + vdev_elevator_switch(spa->spa_root_vdev, (char *)val); + mutex_enter(&spa_namespace_lock); + spa_close(spa, FTAG); + } + mutex_exit(&spa_namespace_lock); } - mutex_exit(&spa_namespace_lock); return (param_set_charp(val, kp)); }