]> 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, 19 Mar 2021 21:09:33 +0000 (14:09 -0700)
commit5f742d3879deb1f46f2d151d5ef84f49e8d6afe6
treee12d9c5dbef88e222ebb10e70b44fba7c2c130c6
parent3cc6f777befc2e494b39a4c0dcd91aaf99267f40
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
sys/fs/nfs/nfs_commonsubs.c
sys/fs/nfs/nfs_var.h