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().

(cherry picked from commit 5f742d3879deb1f46f2d151d5ef84f49e8d6afe6)

Details

Provenance
rmacklemAuthored on Mar 19 2021, 9:09 PM
Parents
rGe0ad785a5d29: libevent1: fix layout of duplicated RB_ENTRY() definition
Branches
Unknown
Tags
Unknown