Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module: zfs: avoid a taking a destroyed lock in zfs_zevent bits #13220

Merged
merged 1 commit into from
Mar 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion module/os/freebsd/spl/spl_sysevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,17 @@ sysevent_worker(void *arg __unused)
nvlist_free(event);
}
}
zfs_zevent_destroy(ze);

/*
* We avoid zfs_zevent_destroy() here because we're otherwise racing
* against fm_fini() destroying the zevent_lock. zfs_zevent_destroy()
* will currently only clear `ze->ze_zevent` from an event list then
* free `ze`, so just inline the free() here -- events have already
* been drained.
*/
VERIFY3P(ze->ze_zevent, ==, NULL);
kmem_free(ze, sizeof (zfs_zevent_t));

kthread_exit();
}

Expand Down