freebsd-skq/sys/fs/nfsclient
Rick Macklem 82ee386c2a 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.

MFC after:	2 weeks
2021-03-23 13:04:37 -07:00
..
nfs_clbio.c nfsclient: add nfs node locking around uses of n_direofoffset 2021-02-28 14:53:54 -08:00
nfs_clcomsubs.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clkdtrace.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clkrpc.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clnfsiod.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs_clnode.c vfs: drop the de facto curthread argument from VOP_INACTIVE 2020-10-20 07:19:03 +00:00
nfs_clport.c Enforce net epoch in in6_selectsrc(). 2021-02-15 22:33:12 +00:00
nfs_clrpcops.c Fix some common typos in comments 2021-03-13 18:26:15 +01:00
nfs_clstate.c nfsv4 client: fix forced dismount when sleeping in the renew thread 2021-03-23 13:04:37 -07:00
nfs_clsubs.c nfsclient: add nfs node locking around uses of n_direofoffset 2021-02-28 14:53:54 -08:00
nfs_clvfsops.c Add a new "tlscertname" NFS mount option. 2020-12-23 13:42:55 -08:00
nfs_clvnops.c nfsclient: add nfs node locking around uses of n_direofoffset 2021-02-28 14:53:54 -08:00
nfs_kdtrace.h fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs.h Remove "struct ucred*" argument from vtruncbuf 2019-05-24 20:27:50 +00:00
nfsmount.h Add a new "tlscertname" NFS mount option. 2020-12-23 13:42:55 -08:00
nfsnode.h Fix interface between nfsclient and vnode pager. 2019-10-22 16:17:38 +00:00
nlminfo.h sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00