diff --git a/module/zfs/include/sys/spa_impl.h b/module/zfs/include/sys/spa_impl.h index 84da684885..8a931a0531 100644 --- a/module/zfs/include/sys/spa_impl.h +++ b/module/zfs/include/sys/spa_impl.h @@ -181,7 +181,7 @@ struct spa { refcount_t spa_refcount; /* number of opens */ }; -extern const char *spa_config_path; +extern char *spa_config_path; #define BOOTFS_COMPRESS_VALID(compress) \ ((compress) == ZIO_COMPRESS_LZJB || \ diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index a589f07584..19dca52c12 100644 --- a/module/zfs/spa_config.c +++ b/module/zfs/spa_config.c @@ -62,7 +62,7 @@ static uint64_t spa_config_generation = 1; * This can be overridden in userland to preserve an alternate namespace for * userland pools when doing testing. */ -const char *spa_config_path = ZPOOL_CACHE; +char *spa_config_path = ZPOOL_CACHE; /* * Called when the module is first loaded, this routine loads the configuration @@ -450,4 +450,7 @@ EXPORT_SYMBOL(spa_all_configs); EXPORT_SYMBOL(spa_config_set); EXPORT_SYMBOL(spa_config_generate); EXPORT_SYMBOL(spa_config_update); + +module_param(spa_config_path, charp, 0444); +MODULE_PARM_DESC(spa_config_path, "SPA config file (/etc/zfs/zpool.cache)"); #endif