]> granicus.if.org Git - zfs/blobdiff - module/zfs/spa.c
OpenZFS 9682 - page fault in dsl_async_clone_destroy() while opening pool
[zfs] / module / zfs / spa.c
index 3785981b7655476b092057bba113d8d3b64c5c1e..f0683b0b84612521a6467765dcf64322b832c8f7 100644 (file)
@@ -4226,8 +4226,17 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
                 */
                spa_history_log_version(spa, "open", NULL);
 
+               spa_restart_removal(spa);
+               spa_spawn_aux_threads(spa);
+
                /*
                 * Delete any inconsistent datasets.
+                *
+                * Note:
+                * Since we may be issuing deletes for clones here,
+                * we make sure to do so after we've spawned all the
+                * auxiliary threads above (from which the livelist
+                * deletion zthr is part of).
                 */
                (void) dmu_objset_find(spa_name(spa),
                    dsl_destroy_inconsistent, NULL, DS_FIND_CHILDREN);
@@ -4237,9 +4246,6 @@ spa_load_impl(spa_t *spa, spa_import_type_t type, char **ereport)
                 */
                dsl_pool_clean_tmp_userrefs(spa->spa_dsl_pool);
 
-               spa_restart_removal(spa);
-
-               spa_spawn_aux_threads(spa);
        }
 
        spa_load_note(spa, "LOADED");