zfs/module/os/freebsd/spl
Kyle Evans bee314a798
module: freebsd: avoid a taking a destroyed lock in zfs_zevent bits
At shutdown time, we drain all of the zevents and set the
ZEVENT_SHUTDOWN flag.  On FreeBSD, we may end up calling
zfs_zevent_destroy() after the zevent_lock has been destroyed while
the sysevent thread is winding down; we observe ESHUTDOWN, then back
out.

Events have already been drained, so just inline the kmem_free call in
sysevent_worker() to avoid the race, and document the assumption that
zfs_zevent_destroy doesn't do anything else useful at that point.

This fixes a panic that can occur at module unload time.

Reviewed-by: Ryan Moeller <freqlabs@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Closes #13220
2022-03-17 10:14:00 -07:00
..
acl_common.c Forbid b{copy,zero,cmp}(). Don't include <strings.h> for <string.h> 2022-03-15 15:13:48 -07:00
callb.c module: mark arguments used 2022-02-18 09:34:03 -08:00
list.c FreeBSD: Clean up ASSERT/VERIFY use in module 2021-04-30 16:36:10 -07:00
sha224.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sha256.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sha256c.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
sha384.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sha512.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
sha512c.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
sha512t.h Add FreeBSD support to OpenZFS 2020-04-14 11:36:28 -07:00
spl_acl.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
spl_atomic.c Update FreeBSD SPL atomics 2020-05-04 15:07:04 -07:00
spl_cmn_err.c Refactor ccompile.h to not include system headers 2020-07-25 20:09:50 -07:00
spl_dtrace.c Refactor ccompile.h to not include system headers 2020-07-25 20:09:50 -07:00
spl_kmem.c FreeBSD: Clean up ASSERT/VERIFY use in module 2021-04-30 16:36:10 -07:00
spl_kstat.c Remove pool io kstats (#12212) 2021-06-10 08:27:33 -07:00
spl_misc.c Refactor ccompile.h to not include system headers 2020-07-25 20:09:50 -07:00
spl_policy.c Share zfs_fsync, zfs_read, zfs_write, et al between Linux and FreeBSD 2020-10-21 14:08:06 -07:00
spl_procfs_list.c FreeBSD: Add support for procfs_list 2020-09-23 16:43:51 -07:00
spl_string.c FreeBSD: Clean up ASSERT/VERIFY use in module 2021-04-30 16:36:10 -07:00
spl_sunddi.c Refactor ccompile.h to not include system headers 2020-07-25 20:09:50 -07:00
spl_sysevent.c module: freebsd: avoid a taking a destroyed lock in zfs_zevent bits 2022-03-17 10:14:00 -07:00
spl_taskq.c Add notes to system_taskq 2021-11-19 10:02:45 -07:00
spl_uio.c FreeBSD: Clean up ASSERT/VERIFY use in module 2021-04-30 16:36:10 -07:00
spl_vfs.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
spl_vm.c Changes to make openzfs build within FreeBSD buildworld 2020-07-31 21:30:31 -07:00
spl_zlib.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00
spl_zone.c Remove bcopy(), bzero(), bcmp() 2022-03-15 15:13:42 -07:00