Page MenuHomeFreeBSD

ASSERT_VOP_LOCKED(): restore diagnostic for the witness use case
ClosedPublic

Authored by kib on Apr 10 2023, 8:54 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 21 2024, 4:44 AM
Unknown Object (File)
Jan 31 2024, 4:08 PM
Unknown Object (File)
Dec 20 2023, 3:50 AM
Unknown Object (File)
Dec 13 2023, 9:02 PM
Unknown Object (File)
Aug 19 2023, 1:26 PM
Unknown Object (File)
Aug 9 2023, 10:36 PM
Unknown Object (File)
Aug 9 2023, 10:30 PM
Unknown Object (File)
Aug 9 2023, 10:27 PM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kib requested review of this revision.Apr 10 2023, 8:54 AM
sys/kern/subr_witness.c
2529

Would it be useful to instead have witness_is_owned() take a mask of LA_ flags like witness_assert() and return a boolean indicating whether the lock satisfied the requested flags?

Also, could the common logic here be factored out into a helper that's used by both witness_assert() and witness_is_owned()?

Another option might be to change witness_assert() to return a boolean and take something like an LA_NOPANIC flag to indicate the caller wants to handle the failed check on its own, then you could keep all the lock-state logic in a single function.

Seems reasonable.

sys/kern/subr_witness.c
2524

Or perhaps, "if witness is disabled"

This revision is now accepted and ready to land.Apr 10 2023, 2:31 PM

Extract common code into witness_find_instance()

This revision now requires review to proceed.Apr 10 2023, 3:59 PM
This revision is now accepted and ready to land.Apr 10 2023, 4:14 PM