HomeFreeBSD

buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS

Description

buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS

Despite the buffer taken from cache or free list, it still can be
locked, due to 'lockless lookup' in getblkx() potentially operating on
the freed buffers. The lock is transient, but prevents the use of
LK_NOWAIT there for the goal of neutralizing WITNESS.

Just use LK_NOWITNESS.

Reported and tested by: pho
Approved by: re (gjb)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 1fb00c8f1060e18fed621f13d31db7b336d2267e)
(cherry picked from commit dd54e44a279fab567374d2eec9dd9cd6d04b7a43)

Details

Provenance
kibAuthored on Feb 16 2022, 3:30 PM
markjCommitted on Mar 14 2022, 3:47 PM
Parents
rG408fc21842a8: zfs: merge openzfs/zfs@ef83e07db (zfs-2.1-release) into releng/13.1
Branches
Unknown
Tags
Unknown