HomeFreeBSD

buf_alloc(): lock the buffer with LK_NOWAIT

Description

buf_alloc(): lock the buffer with LK_NOWAIT

The buffer must not be accessed by any other thread, it is freshly
allocated. As such, LK_NOWAIT should be nop but also it prevents
recording the order between the buffer lock and any other locks we might
own in the call to getnewbuf(). In particular, if we own FFS snap lock,
it should avoid triggering false positive warning.

Reviewed by: markj, mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34072

Details

Provenance
kibAuthored on Jan 18 2022, 1:39 AM
Reviewer
markj
Differential Revision
D34072: Useful changes taken from D33921
Parents
rG531f8cfea06b: Use dedicated lock name for pbufs
Branches
Unknown
Tags
Unknown