From ca23981d95b0a1581f02dd139226b9dea9266ed3 Mon Sep 17 00:00:00 2001 From: Turbo Fredriksson Date: Thu, 25 Jun 2015 14:53:20 +0200 Subject: [PATCH] Change default cachefile property to 'none'. This in preparation to a later complete removal of cache file. A cache file is almost never needed, at least not on Linux, so the long-time plan is to remove it altogether. This is the first step. --- man/man5/zfs-module-parameters.5 | 2 +- man/man8/zpool.8 | 4 +++- module/zcommon/zpool_prop.c | 2 +- module/zfs/spa_config.c | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/man/man5/zfs-module-parameters.5 b/man/man5/zfs-module-parameters.5 index 6d4a8c3048cc..e047c54e0536 100644 --- a/man/man5/zfs-module-parameters.5 +++ b/man/man5/zfs-module-parameters.5 @@ -236,7 +236,7 @@ Use \fB1\fR for yes (default) and \fB0\fR for no. .RS 12n SPA config file .sp -Default value: \fB/etc/zfs/zpool.cache\fR. +Default value: \fBnone\fR. .RE .sp diff --git a/man/man8/zpool.8 b/man/man8/zpool.8 index 062b5ae290d0..f5b5eecd607f 100644 --- a/man/man8/zpool.8 +++ b/man/man8/zpool.8 @@ -698,9 +698,11 @@ Identifies the default bootable dataset for the root pool. This property is expe .ad .sp .6 .RS 4n -Controls the location of where the pool configuration is cached. Discovering all pools on system startup requires a cached copy of the configuration data that is stored on the root file system. All pools in this cache are automatically imported when the system boots. Some environments, such as install and clustering, need to cache this information in a different location so that pools are not automatically imported. Setting this property caches the pool configuration in a different location that can later be imported with "\fBzpool import -c\fR". Setting it to the special value "\fBnone\fR" creates a temporary pool that is never cached, and the special value \fB\&''\fR (empty string) uses the default location. +Controls the location of where the pool configuration is cached. Discovering all pools on system startup requires a cached copy of the configuration data that is stored on the root file system. All pools in this cache are automatically imported when the system boots. Some environments, such as install and clustering, need to cache this information in a different location so that pools are not automatically imported. Setting this property caches the pool configuration in a different location that can later be imported with "\fBzpool import -c\fR". Setting it to the special value "\fBnone\fR" creates a temporary pool that is never cached, and the special value \fB\&''\fR (empty string) uses the default location (\fI/etc/zfs/zpool.cache\fR). .sp Multiple pools can share the same cache file. Because the kernel destroys and recreates this file when pools are added and removed, care should be taken when attempting to access this file. When the last pool using a \fBcachefile\fR is exported or destroyed, the file is removed. +.sp +On Linux, a cache file is almost never needed. So the default for Linux is set to \fBnone\fR. .RE .sp diff --git a/module/zcommon/zpool_prop.c b/module/zcommon/zpool_prop.c index 910c56dcc2a9..f09e099a01c4 100644 --- a/module/zcommon/zpool_prop.c +++ b/module/zcommon/zpool_prop.c @@ -69,7 +69,7 @@ zpool_prop_init(void) ZFS_TYPE_POOL, "", "ALTROOT"); zprop_register_string(ZPOOL_PROP_BOOTFS, "bootfs", NULL, PROP_DEFAULT, ZFS_TYPE_POOL, "", "BOOTFS"); - zprop_register_string(ZPOOL_PROP_CACHEFILE, "cachefile", NULL, + zprop_register_string(ZPOOL_PROP_CACHEFILE, "cachefile", "none", PROP_DEFAULT, ZFS_TYPE_POOL, " | none", "CACHEFILE"); zprop_register_string(ZPOOL_PROP_COMMENT, "comment", NULL, PROP_DEFAULT, ZFS_TYPE_POOL, "", "COMMENT"); diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index 929f18165934..5caa35e89057 100644 --- a/module/zfs/spa_config.c +++ b/module/zfs/spa_config.c @@ -63,7 +63,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. */ -char *spa_config_path = ZPOOL_CACHE; +char *spa_config_path = "none"; int zfs_autoimport_disable = 1; /* @@ -574,7 +574,7 @@ 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)"); +MODULE_PARM_DESC(spa_config_path, "SPA config file (none)"); module_param(zfs_autoimport_disable, int, 0644); MODULE_PARM_DESC(zfs_autoimport_disable, "Disable pool import at module load");