summaryrefslogtreecommitdiffstats
path: root/module/zfs/spa_config.c
diff options
context:
space:
mode:
authorDan Swartzendruber <[email protected]>2014-10-09 16:45:46 -0400
committerBrian Behlendorf <[email protected]>2015-02-17 16:09:41 -0800
commit1611bb7b4fb06cfe43730222e40ef6a109138f12 (patch)
treef730f423c425928d5a74f53980c43b7124720257 /module/zfs/spa_config.c
parent7d2868d5fc88a4c30769b44f56a3a88a4277a9ab (diff)
Set zfs_autoimport_disable default value to 1
When loading the ZFS kernel modules they should not populate the spa namespace using the cache file. This behavior isn't consistent with other Linux kernel modules and we need to move away from it. Removing this makes the whole startup process predictable with four basic steps which are driven by the init system. 1) modprobe 2) zpool import 3) zfs mount 4) zfs share This change also helps lay the groundwork for eventually removing the kobj_* compatibility code on the kernel side. It may need to be preserved in userspace because libzfs_init() depends on it. This is why the conditional must be wrapped with an #ifdef _KERNEL. Signed-off-by: Dan Swartzendruber <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2820
Diffstat (limited to 'module/zfs/spa_config.c')
-rw-r--r--module/zfs/spa_config.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c
index ed2344cf3..624bcb788 100644
--- a/module/zfs/spa_config.c
+++ b/module/zfs/spa_config.c
@@ -64,7 +64,7 @@ static uint64_t spa_config_generation = 1;
* userland pools when doing testing.
*/
char *spa_config_path = ZPOOL_CACHE;
-int zfs_autoimport_disable = 0;
+int zfs_autoimport_disable = 1;
/*
* Called when the module is first loaded, this routine loads the configuration
@@ -81,8 +81,10 @@ spa_config_load(void)
struct _buf *file;
uint64_t fsize;
+#ifdef _KERNEL
if (zfs_autoimport_disable)
return;
+#endif
/*
* Open the configuration file.