HomeFreeBSD

witness: Record the first acquired file and line for recursable locks

Description

witness: Record the first acquired file and line for recursable locks

and the last acquired file and line to witness object.

For recursable locks, unfortunately current implementation records only
the recurse count and the last acquired file and line, but does not
restore the previous acquired file and line on unlock. Hence it is
possible to report false acquired file and line, and that may mislead
developers and make the report by users a little harder to analyse.

Since subsequent recurse locks do not affect how witness order check,
record the first acquired file and line so that the logic is much clear.

Reported by: bz
Reviewed by: kib (previous version), markj
See also: https://lists.freebsd.org/archives/freebsd-current/2025-June/007944.html
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D52496

Details

Provenance
zleiAuthored on Sep 17 2025, 4:48 PM
Reviewer
kib
Differential Revision
D52496: witness: Record the first acquired file and line for recursable locks
Parents
rG08d41d8803d9: ObsoleteFiles: Remove the miscapitalized vnet.9
Branches
Unknown
Tags
Unknown