Skip to content

Commit

Permalink
Change default cachefile property to 'none'.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
FransUrbo committed Sep 8, 2015
1 parent 3b36f83 commit ca23981
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion man/man5/zfs-module-parameters.5
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion man/man8/zpool.8
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion module/zcommon/zpool_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ zpool_prop_init(void)
ZFS_TYPE_POOL, "<path>", "ALTROOT");
zprop_register_string(ZPOOL_PROP_BOOTFS, "bootfs", NULL, PROP_DEFAULT,
ZFS_TYPE_POOL, "<filesystem>", "BOOTFS");
zprop_register_string(ZPOOL_PROP_CACHEFILE, "cachefile", NULL,
zprop_register_string(ZPOOL_PROP_CACHEFILE, "cachefile", "none",
PROP_DEFAULT, ZFS_TYPE_POOL, "<file> | none", "CACHEFILE");
zprop_register_string(ZPOOL_PROP_COMMENT, "comment", NULL,
PROP_DEFAULT, ZFS_TYPE_POOL, "<comment-string>", "COMMENT");
Expand Down
4 changes: 2 additions & 2 deletions module/zfs/spa_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit ca23981

Please sign in to comment.