freebsd-dev/module
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
..
avl Clean up CSTYLEDs 2022-01-26 11:38:52 -08:00
icp Forbid b{copy,zero,cmp}(). Don't include <strings.h> for <string.h> 2022-03-15 15:13:48 -07:00
lua Use _Noreturn (C11; GNU89) properly 2022-03-04 16:25:22 -08:00
nvpair Forbid b{copy,zero,cmp}(). Don't include <strings.h> for <string.h> 2022-03-15 15:13:48 -07:00
os module: freebsd: avoid a taking a destroyed lock in zfs_zevent bits 2022-03-17 10:14:00 -07:00
spl Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
unicode Forbid b{copy,zero,cmp}(). Don't include <strings.h> for <string.h> 2022-03-15 15:13:48 -07:00
zcommon Forbid b{copy,zero,cmp}(). Don't include <strings.h> for <string.h> 2022-03-15 15:13:48 -07:00
zfs Forbid b{copy,zero,cmp}(). Don't include <strings.h> for <string.h> 2022-03-15 15:13:48 -07:00
zstd module: zstd: check we don't leak symbols; regenerate symbol map 2022-03-15 16:10:10 -07:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in Add zstd support to zfs 2020-08-20 10:30:06 -07:00
Makefile.bsd Explode zstd 1.4.5 into separate upstream files 2022-03-01 13:55:12 -08:00
Makefile.in Re-apply 6ba2e72b, silence lint 2022-03-01 13:56:00 -08:00