summaryrefslogtreecommitdiffstats
path: root/module/zfs/spa_config.c
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2020-08-17 14:43:47 -0700
committerGitHub <[email protected]>2020-08-17 14:43:47 -0700
commit5f1984f2f83624b30dbdaa5d906a6253d78efb66 (patch)
treead7d14b60650e78a348edfeb266ec8e78e6666fc /module/zfs/spa_config.c
parent9352d8c00402d2b10c0a2f547445dadda3bb0062 (diff)
FreeBSD: fallback to /boot/ to look for zpool.cache
Up until now zpool.cache has always lived in /boot on FreeBSD. For the sake of compatibility fallback to /boot if zpool.cache isn't found in /etc/zfs. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10720
Diffstat (limited to 'module/zfs/spa_config.c')
-rw-r--r--module/zfs/spa_config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c
index b30c65e71..95dd19844 100644
--- a/module/zfs/spa_config.c
+++ b/module/zfs/spa_config.c
@@ -100,6 +100,10 @@ spa_config_load(void)
err = zfs_file_open(pathname, O_RDONLY, 0, &fp);
+#ifdef __FreeBSD__
+ if (err)
+ err = zfs_file_open(ZPOOL_CACHE_BOOT, O_RDONLY, 0, &fp);
+#endif
kmem_free(pathname, MAXPATHLEN);
if (err)