HomeFreeBSD

nfsd: Allow a mutex lock for clientID handling

Description

nfsd: Allow a mutex lock for clientID handling

On Feb. 28, a problem was reported on freebsd-stable@ where a
nfsd thread processing an ExchangeID operation was blocked for
a long time by another nfsd thread performing a copy_file_range.
This occurred because the copy_file_range was taking a long time,
but also because handling a clientID requires that all other nfsd
threads be blocked via an exclusive lock, as required by ExchangeID.

This patch allows clientID handling to be done with only a mutex
held (instead of an exclusive lock that blocks all other nfsd threads)
when vfs.nfsd.enable_locallocks is 0. For the case of
vfs.nfsd.enable_locallocks set to 1, the exclusive lock that
blocks all nfsd threads is still required.

This patch does make changing the value of vfs.nfsd.enable_locallocks
somewhat racy. A future commit will ensure any change is done when
all nfsd threads are blocked to avoid this racyness.

MFC after: 1 month

Details

Provenance
rmacklemAuthored on Sat, Jun 22, 10:56 PM
Parents
rG48dbc2a4f9fc: mailmap: Translate my personal address
Branches
Unknown
Tags
Unknown