HomeFreeBSD

nfsv4 client: fix forced dismount when sleeping on nfsv4lck

Description

nfsv4 client: fix forced dismount when sleeping on nfsv4lck

During a recent NFSv4 testing event a test server caused a hang
where "umount -N" failed. The renew thread was sleeping on "nfsv4lck"
and the "umount" was sleeping, waiting for the renew thread to
terminate.

This is the first of two patches that is hoped to fix the renew thread
so that it will terminate when "umount -N" is done on the mount.

nfsv4_lock() checks for forced dismount, but only after it wakes up
from msleep(). Without this patch, a wakeup() call was required.
This patch adds a 1second timeout on the msleep(), so that it will
wake up and see the forced dismount flag. Normally a wakeup()
will occur in less than 1second, but if a premature return from
msleep() does occur, it will simply loop around and msleep() again.

While here, replace the nfsmsleep() wrapper that was used for portability
with the actual msleep() call and make the same change for nfsv4_getref().

MFC after: 2 weeks

Details

Provenance
rmacklemAuthored on Mar 19 2021, 9:09 PM
Parents
rG3cc6f777befc: cxgbe(4): create a separate helper routine to write the global RSS key.
Branches
Unknown
Tags
Unknown