[Bug 268116] reboot after readding ZIL device to ZFS

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 02 Dec 2022 06:29:10 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=268116

            Bug ID: 268116
           Summary: reboot after readding ZIL device to ZFS
           Product: Base System
           Version: 13.1-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: cmiu147@gmail.com

Hi, i'm facing a weird problem. I tested this on multiple machines with
multiple ZFS array (zfs stripe, mirror, raidz1).
This problem appears only on FreeBSD 13.1-RELEASE, 13.1-STABLE and 14-CURRENT.

So, here is the scenario:

1. I create a new log and cache device using the following commands:
gpart create -s gpt nvd0
gpart add -a 4k -s 50G -t freebsd-zfs -l log nvd0
gpart add -a 4k -s 50G -t freebsd-zfs -l cache nvd0
zpool add zroot log /dev/gpt/log
zpool add zroot cache /dev/gpt/cache 

2. I reboot the machine, everything works as it should, ZFS devices are
displayed correctly. 

3. I realise that i want to allocate less space for log and more for cache for
example. I remove the log and cache from the pool with the following commands:

zpool remove zroot /dev/gpt/cache
zpool remove zroot /dev/gpt/log

4. I reboot the machine, to ensure that everything is ok. The machine is
booting correctly.

5. I destroy the array and recreate it, then added to the pool using the
following commands:

gpart destroy -F /dev/nvd0
gpart create -s gpt /dev/nvd0
gpart add -a 4k -s 16G -t freebsd-zfs -l log nvd0
gpart add -a 4k -s 84G -t freebsd-zfs -l cache nvd0
zpool add zroot log /dev/gpt/log
zpool add zroot cache /dev/gpt/cache 

6. Everything is ok, is working for the moment. 
7. I reboot the system, the bootloader is loading, and the system start to boot
and when trying to mount the log device the system reboots automatically. 
8. I tried to remove only the cache device from the pool using the command

zpool remove zroot /dev/gpt/cache

9. I reboot the system, same result, the system reboots.

10. Getting back to usb drive, import the zfs, remove the log, add the cache.
The system booting normally using only the cache device.
11. I tried using different ssd, separate log and cache to different psychical 
devices, same result.

12. I made a fresh install of freebsd 14-CURRENT and reproduce all the steps
above... the system reboots exactly the same only with log device attached.

Here is the kernel panic message i got:

VERIFY0(0 == nvlist_lookup_uint64(nvl, name, &rv)) failed (0 == 22)


Is there a workaround to fix this?

Thank you!

-- 
You are receiving this mail because:
You are the assignee for the bug.