Dear David, On 2020-11-22, David Brownlee wrote: > I'm seeing a (new?) panic on netbsd-9 with zfs. It seems to trigger > when a newly created zfs pool attempts to be mounted: > > panic: vrelel: bad ref count > cpu0: Begin traceback... > vpanic() at netbsd:vpanic+0x160 > vcache_reclaim() at netbsd:vcache_reclaim > vrelel() at netbsd:vrelel+0x22e > vdev_disk_open.part.4() at zfs:vdev_disk_open.part.4+0x44e > vdev_open() at zfs:vdev_open+0x9e > vdev_open_children() at zfs:vdev_open_children+0x39 > vdev_root_open() at zfs:vdev_root_open+0x33 > vdev_open() at zfs:vdev_open+0x9e > vdev_create() at zfs:vdev_create+0x1b > spa_create() at zfs:spa_create+0x28c > zfs_ioc_pool_create() at zfs:zfs_ioc_pool_create+0x19b > zfsdev_ioctl() at zfs:zfsdev_ioctl+0x265 > nb_zfsdev_ioctl() at zfs:nb_zfsdev_ioctl+0x38 > VOP_IOCTL() at netbsd:VOP_IOCTL+0x54 > vn_ioctl() at netbsd:vn_ioctl+0xa5 > sys_ioctl() at netbsd:sys_ioctl+0x5ab > syscall() at netbsd:syscall+0x157 > --- syscall (number 54) --- > 7e047af6822a: > cpu0: End traceback... > > Anyone seeing anything similar (I continue to have a bunch of other > boxes which use zfs without issue) > > David
I don't know if it helps, but it looks like vn_close(vp,..) should be called instead of vrele(vp) at https://nxr.netbsd.org/xref/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c#218 and https://nxr.netbsd.org/xref/external/cddl/osnet/dist/uts/common/fs/zfs/vdev_disk.c#250 -- Kind regards, Yorick Hardy
