]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
nfsv4 client: fix forced dismount when sleeping in the renew thread
authorRick Macklem <rmacklem@FreeBSD.org>
Tue, 23 Mar 2021 20:04:37 +0000 (13:04 -0700)
committerRick Macklem <rmacklem@FreeBSD.org>
Sun, 11 Apr 2021 22:34:52 +0000 (15:34 -0700)
commite18f9de0612137924951a0ec709eb36286bb3894
tree0114c6846d6f11a6246f92e0a312feede6955e1e
parent30b132ffe6999013e8b1cf5d85ed645495ac36d0
nfsv4 client: fix forced dismount when sleeping in the renew thread

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 second of two patches that is hoped to fix the renew thread
so that it will terminate when "umount -N" is done on the mount.

This patch adds a 5second timeout on the msleep()s and checks for
the forced dismount flag so that the renew thread will
wake up and see the forced dismount flag.  Normally a wakeup()
will occur in less than 5seconds, but if a premature return from
msleep() does occur, it will simply loop around and msleep() again.
The patch also adds the "mp" argument to nfsv4_lock() so that it
will return when the forced dismount flag is set.

While here, replace the nfsmsleep() wrapper that was used for portability
with the actual msleep() call.

(cherry picked from commit 82ee386c2afb42388804c1189751b83048953433)
sys/fs/nfsclient/nfs_clstate.c