HomeFreeBSD

Linux: Assert mutex is held in mutex_exit()

Description

Linux: Assert mutex is held in mutex_exit()

A spurious mutex_exit() in a development branch caused weird issues
until I identified it. An assertion prior to mutex_exit() would have
caught it. Rather than adding assertions before invocations of
mutex_exit() in the code, let us simply add an assertion to
mutex_exit(). It is cheap and will likely improve developer
productivity.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Richard Yao <richard.yao@klarasystems.com>
Sponsored-By: Wasabi Technology, Inc.
Closes #14541

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Mar 1 2023, 1:27 AM
GitHub <noreply@github.com>Committed on Mar 1 2023, 1:27 AM
Parents
rG13ff72ba0af1: Revert zfeature_active() to static
Branches
Unknown
Tags
Unknown

Event Timeline

GitHub <noreply@github.com> committed rG2f76797ad9b6: Linux: Assert mutex is held in mutex_exit() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Mar 1 2023, 1:27 AM