summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2013-07-03 09:55:39 -0700
committerBrian Behlendorf <[email protected]>2013-07-09 10:11:19 -0700
commit31455ab13056da037410353f10c484dfca3d3ebc (patch)
tree8132a6d33c1a585cc44d689c642cc93ef9e5248b
parent50fe577d1f3bd06e15fe2006459debd9fdffd04a (diff)
Add zfs_autoimport_disable tunable
There are times when it is desirable for zfs to not automatically populate the spa namespace at module load time using the pools in the /etc/zfs/zpool.cache file. The zfs_autoimport_disable module option has been added to control this behavior. Signed-off-by: Brian Behlendorf <[email protected]> Issue #330
-rw-r--r--module/zfs/spa_config.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c
index 09149e622..849ae46ec 100644
--- a/module/zfs/spa_config.c
+++ b/module/zfs/spa_config.c
@@ -65,6 +65,7 @@ static uint64_t spa_config_generation = 1;
* userland pools when doing testing.
*/
char *spa_config_path = ZPOOL_CACHE;
+int zfs_autoimport_disable = 0;
/*
* Called when the module is first loaded, this routine loads the configuration
@@ -81,6 +82,9 @@ spa_config_load(void)
struct _buf *file;
uint64_t fsize;
+ if (zfs_autoimport_disable)
+ return;
+
/*
* Open the configuration file.
*/
@@ -508,4 +512,8 @@ 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)");
+
+module_param(zfs_autoimport_disable, int, 0644);
+MODULE_PARM_DESC(zfs_autoimport_disable, "Disable pool import at module load");
+
#endif