mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
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
|
* The location of the pool configuration repository, shared between kernel and
|
||||||
* userland.
|
* userland.
|
||||||
*/
|
*/
|
||||||
|
#define ZPOOL_CACHE_BOOT "/boot/zfs/zpool.cache"
|
||||||
#define ZPOOL_CACHE "/etc/zfs/zpool.cache"
|
#define ZPOOL_CACHE "/etc/zfs/zpool.cache"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* vdev states are ordered from least to most healthy.
|
* vdev states are ordered from least to most healthy.
|
||||||
* A vdev that's CANT_OPEN or below is considered unusable.
|
* 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);
|
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);
|
kmem_free(pathname, MAXPATHLEN);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
|
Loading…
Reference in New Issue
Block a user