HomeFreeBSD

Threads holding a read lock of a sleepable rm lock are not permitted

Description

Threads holding a read lock of a sleepable rm lock are not permitted
to sleep. The rmlock implementation enforces this by disabling
sleeping when a read lock is acquired. To simplify the implementation,
sleeping is disabled for most of the duration of rm_rlock. However,
it doesn't need to be disabled until the lock is acquired. If a
sleepable rm lock is contested, then rm_rlock may need to acquire the
backing sx lock. This tripped the overly-broad assertion. Fix by
relaxing the assertion around the call to sx_xlock().

Reported by: mjg
Reviewed by: kib, mjg
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D3324

Details

Provenance
jhbAuthored on
Reviewer
kib
Differential Revision
D3324: Fix incorrect assertion in a blocking rm_rlock.
Parents
rS287832: Remove redundant 'man page'
Branches
Unknown
Tags
Unknown