HomeFreeBSD

getblk: Avoid sleeping on wrong buf in lockless path

Description

getblk: Avoid sleeping on wrong buf in lockless path

If the buffer identity changed during lookup, sleeping could introduce a
lock order reversal. Since we do not know if the identity changed until we
get the lock, we must try-lock (LK_NOWAIT) only. EINTR and ERESTART error
handling becomes irrelevant, as we no longer sleep.

Reported by: kib
Reviewed by: kib
X-MFC-With: r363482
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D25898

Details

Provenance
cemAuthored on Jul 31 2020, 12:07 AM
Parents
rG9119bafbaf52: Import PCG-C into sys/contrib
Branches
Unknown
Tags
Unknown

Event Timeline