Bug 237067

Summary: ZFS: Crash in vdev_dtl_reassess when using GELI with autodetach
Product: Base System Reporter: vi
Component: kernAssignee: freebsd-fs (Nobody) <fs>
Status: Open ---    
Severity: Affects Some People Keywords: needs-qa, panic
Priority: --- Flags: koobs: mfc-stable12?
koobs: mfc-stable11?
Version: 12.0-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Core dump log none

Description vi 2019-04-07 04:48:15 UTC
When using GELI with autodetach enabled (which it is by default if using geli_devices in rc.conf) enabled, ZFS can trigger a panic.

Steps to reproduce:

- Create a VM with FreeBSD 12.0-RELEASE rootfs and two attached drives, which I'll be calling ada0 and ada1 for simplicity
- Format the devices with geli init with no passphrase:
# dd if=/dev/random of=/root/k bs=64 count=1
# geli init -PK /root/k ada0
# geli init -PK /root/k ada1
- Attach to the devices and set up a mirrored zpool (I don't know if the mirroring is needed, this is just what my setup was when I discovered it):
# geli attach -pk /root/k ada0
# geli attach -pk /root/k ada1
# zpool create pool mirror ada0.eli ada1.eli
- Ensure zfs and geli load at boot:
# cat >> /boot/loader.conf <<END
zfs_load="YES"
geom_eli_load="YES"
END
# cat >> /etc/rc.conf <<END
geli_devices="ada0 ada1"
geli_ada0_flags="-p -k /root/k"
geli_ada1_flags="-p -k /root/k"
END
- Reboot the VM and run `zpool status`

Expected results:
- GELI and ZFS work and it shows the status of `pool`

Actual results:
- Kernel panic in vdev_dtl_reassess

I don't seem to have a way to gather the crashlog from this VM (I'm using VMware Player on Linux to reproduce at the moment) otherwise I'd attach it.

Configuration:
- Running stock amd64 FreeBSD 12.0-RELEASE on a fresh installation.
Comment 1 vi 2019-04-07 05:15:02 UTC
Created attachment 203438 [details]
Core dump log

Found a core.txt from the live system where I first ran into this. Also tried reproducing it with only one geli device/vdev, which also crashes similarly.