X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fspa.c;h=65f78b7846af4932f3f44808ed30c318aa8866fa;hb=refs%2Fheads%2Frertzinger%2Ffeature-zpool-get--p;hp=e986e924d3e34317ee444f2bd477d06782c6f109;hpb=294f68063b49c06d3118d51016811063e69cf97a;p=zfs.git diff --git a/module/zfs/spa.c b/module/zfs/spa.c index e986e92..65f78b7 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -64,6 +64,7 @@ #include #include #include +#include #ifdef _KERNEL #include @@ -2856,6 +2857,7 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy, spa_load_state_t state = SPA_LOAD_OPEN; int error; int locked = B_FALSE; + int firstopen = B_FALSE; *spapp = NULL; @@ -2879,6 +2881,8 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy, if (spa->spa_state == POOL_STATE_UNINITIALIZED) { zpool_rewind_policy_t policy; + firstopen = B_TRUE; + zpool_get_rewind_policy(nvpolicy ? nvpolicy : spa->spa_config, &policy); if (policy.zrp_request & ZPOOL_DO_REWIND) @@ -2953,6 +2957,11 @@ spa_open_common(const char *pool, spa_t **spapp, void *tag, nvlist_t *nvpolicy, mutex_exit(&spa_namespace_lock); } +#ifdef _KERNEL + if (firstopen) + zvol_create_minors(spa->spa_name); +#endif + *spapp = spa; return (0); @@ -4010,6 +4019,10 @@ spa_import(const char *pool, nvlist_t *config, nvlist_t *props, uint64_t flags) mutex_exit(&spa_namespace_lock); spa_history_log_version(spa, LOG_POOL_IMPORT); +#ifdef _KERNEL + zvol_create_minors(pool); +#endif + return (0); }