zfsonfreebsd / ZoF

ZFS on FreeBSD - the official out of tree OpenZFS implementation for FreeBSD
https://freebsd.org
Other
100 stars 8 forks source link

ZoF panics are boot when trying to read zpool.cache #154

Closed allanjude closed 4 years ago

allanjude commented 4 years ago

With vfs.zfs.autoimport_disable=0 the system panics in pwd_ensure_dirs() while trying to read the cache file, because the root filesystem is not there yet.

This restores the code from FreeBSD's old solaris compat, to fetch zpool.cache from the loader module data cache.

It also resolves a NULL pointer dereference in zfs_file_read() when called from spa_config_load()

allanjude commented 4 years ago

At boot, this seems to get further, but now panics in:

fletcher_4_benchmark_impl()

when entering or exiting the FPU with:

panic: recursive fpu_kern_enter while in PCB_FPUNOSAVE state
ghost commented 4 years ago

Can you explain a little bit what autoimport_disable=0 is for? I’ve been booting ZoF without that for a while.

ghost commented 4 years ago

Allan explained to me in Slack that when booting from a UFS root this needs to be set for pools to be imported on boot. Or more generally, autoimport_disable=0 means non-root pools will be reimported automatically at boot or module load after boot. The PR brings in the parts needed for the "at boot" case to occur before root is mounted.

ghost commented 4 years ago

I don't think there's a case where we need this in order to boot, and importing non-root pools can be deferred until the /etc/rc.d/zfs script runs to mount them.

mattmacy commented 4 years ago

I don't think there's a case where we need this in order to boot, and importing non-root pools can be deferred until the /etc/rc.d/zfs script runs to mount them.

It seems reasonable, but at this point it makes more sense to target this change at OpenZFS in a day or two.

ghost commented 4 years ago

This should be pursued upstream.