Linux: Assert mutex is held in mutex_exit()
commit2f76797ad9b630751fad9b10aa7aa4a1737c4300
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Wed, 1 Mar 2023 01:27:20 +0000 (28 20:27 -0500)
committerGitHub <noreply@github.com>
Wed, 1 Mar 2023 01:27:20 +0000 (28 17:27 -0800)
tree0be7f93612cec82797f45b7666d87203421caf08
parent13ff72ba0af1ea52d8d67bb802c66b9f214af42c
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
include/os/linux/spl/sys/mutex.h