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)
Fri, Jan 24, 5:46 PM
Unknown Object (File)
Sat, Jan 18, 9:36 PM
Unknown Object (File)
Dec 15 2024, 12:49 AM
Unknown Object (File)
Nov 19 2024, 9:57 PM
Unknown Object (File)
Nov 8 2024, 12:25 AM
Unknown Object (File)
Oct 2 2024, 5:00 PM
Unknown Object (File)
Oct 1 2024, 10:48 PM
Unknown Object (File)
Oct 1 2024, 7:17 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