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
Reviewer
kib
Differential Revision
D25898: getblk: Avoid sleeping on wrong buf in lockless path
Parents
rS363720: Import PCG-C into sys/contrib
Branches
Unknown
Tags
Unknown