freebsd-skq/sys/fs/nfsclient
kib 8b66e16967 Do not drop NFS vnode lock when performing consistency checks.
Currently several paths in the NFS client upgrade the shared vnode
lock to exclusive, which might cause temporal dropping of the lock.
This action appears to be fatal for nullfs mounts over NFS. If the
operation is performed over nullfs vnode, then bypassed down to NFS
VOP, and the lock is dropped, other thread might reclaim the upper
nullfs vnode.  Since on reclaim the nullfs vnode lock and NFS vnode
lock are split, the original lock state of the nullfs vnode is not
restored.  As result, VFS operations receive not locked vnode after a
VOP call.

Stop upgrading the vnode lock when we check the consistency or flush
buffers as result of detected inconsistency.  Instead, allocate a new
lockmgr lock for each NFS node, which is locked exclusive instead of
the vnode lock upgrade.  In other words, the other parallel
modification of the vnode are excluded by either vnode lock conflict
or exclusivity of the new lock when the vnode lock is shared.

Also revert r316529 because now the vnode cannot be reclaimed during
ncl_vinvalbuf().

In collaboration with:	pho
Reviewed by:	rmacklem
Reported and tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D12083
2017-08-20 10:08:45 +00:00
..
nfs_clbio.c Do not drop NFS vnode lock when performing consistency checks. 2017-08-20 10:08:45 +00:00
nfs_clcomsubs.c Add two new compound RPCs to the NFSv4.1/pNFS client. 2017-06-24 20:01:21 +00:00
nfs_clkdtrace.c NFS: spelling fixes on comments. 2016-04-29 16:07:25 +00:00
nfs_clkrpc.c Add call to svcpool_close() for the NFSv4 callback pool (svcpool_nfscbd). 2017-04-13 20:16:29 +00:00
nfs_clnfsiod.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
nfs_clnode.c Do not drop NFS vnode lock when performing consistency checks. 2017-08-20 10:08:45 +00:00
nfs_clport.c Do not drop NFS vnode lock when performing consistency checks. 2017-08-20 10:08:45 +00:00
nfs_clrpcops.c Fix possible crash for the NFSv4.1 pNFS client. 2017-07-29 02:25:49 +00:00
nfs_clstate.c Replace the checks for MNTK_UNMOUNTF with a macro that does the same thing. 2017-07-27 20:55:31 +00:00
nfs_clsubs.c Do not drop NFS vnode lock when performing consistency checks. 2017-08-20 10:08:45 +00:00
nfs_clvfsops.c Add kernel support for the NFS client forced dismount "umount -N" option. 2017-07-29 19:52:47 +00:00
nfs_clvnops.c Do not drop NFS vnode lock when performing consistency checks. 2017-08-20 10:08:45 +00:00
nfs_kdtrace.h
nfs.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
nfsmount.h Add kernel support for the NFS client forced dismount "umount -N" option. 2017-07-29 19:52:47 +00:00
nfsnode.h Do not drop NFS vnode lock when performing consistency checks. 2017-08-20 10:08:45 +00:00
nlminfo.h