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.

(cherry picked from commit dfaeeacc2cc29d0497ecd4cd5b7fd0d5ab61fcd5)

Details

Provenance
rmacklemAuthored on Jun 22 2024, 10:56 PM
Parents
rGfad8955b97cc: leap-seconds: Update to leap-seconds 3960057600 obtained from IERS
Branches
Unknown
Tags
Unknown