HomeFreeBSD

nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex

Description

nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex

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 adds two arguments to nfsv4_cleanclient() so that it
can optionally be called with a mutex held. For this patch, the
first of these arguments is "false" and, as such, there is no
change in semantics. However, this change will allow a future
commit to modify handling of the clientID so that it can be done
with a mutex held while other nfsd threads continue to process
NFS RPCs.

(cherry picked from commit a7de51068502ad1e2851d4a855ed28b27573bb36)

Details

Provenance
rmacklemAuthored on Jun 21 2024, 10:08 PM
Parents
rG9746cb2197a1: nvmecontrol: Fix "Workloadd" typo
Branches
Unknown
Tags
Unknown