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 <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10720
This commit is contained in:
Matthew Macy
2020-08-17 14:43:47 -07:00
committed by GitHub
parent 9352d8c004
commit 5f1984f2f8
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -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)