]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfsv4 client: fix forced dismount when sleeping on nfsv4lck
authorRick Macklem <rmacklem@FreeBSD.org>
Fri, 19 Mar 2021 21:09:33 +0000 (14:09 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Fri, 2 Apr 2021 00:26:44 +0000 (17:26 -0700)
commitfd1c5c6cfca58a47bc087b0722360f76024a2594
tree24c9a9e47fc8cd473037ecca39eb9eb4cddcf2b1
parente655b00a964f834995b5164dd1edeeafb6b74a44
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)
sys/fs/nfs/nfs_commonsubs.c
sys/fs/nfs/nfs_var.h