mirror of https://github.com/openzfs/zfs.git
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:
parent
9352d8c004
commit
5f1984f2f8
|
@ -829,8 +829,8 @@ typedef struct zpool_load_policy {
|
|||
* The location of the pool configuration repository, shared between kernel and
|
||||
* userland.
|
||||
*/
|
||||
#define ZPOOL_CACHE_BOOT "/boot/zfs/zpool.cache"
|
||||
#define ZPOOL_CACHE "/etc/zfs/zpool.cache"
|
||||
|
||||
/*
|
||||
* vdev states are ordered from least to most healthy.
|
||||
* A vdev that's CANT_OPEN or below is considered unusable.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue