freebsd-skq/sys/fs/nfs
kib ae2561e593 Fix interface between nfsclient and vnode pager.
Make the nfsclient always call vnode_pager_setsize() with the vnode
exclusively locked.  This ensures that page fault always can find the
backing page if the object size check succeeded.  Set VV_VMSIZEVNLOCK
flag on NFS nodes.

The main offender breaking the interface in nfsclient is
nfs_loadattrcache(), which is used whenever server responded with
updated attributes, which can happen on non-changing operations as
well.  Also, iod threads only have buffers locked (and even that is
LK_KERNPROC), but they still may call nfs_loadattrcache() on RPC
response.

Instead of immediately calling vnode_pager_setsize() if server
response indicated changed file size, but the vnode is not exclusively
locked, set a new node flag NVNSETSZSKIP.  When the vnode exclusively
locked, or when we can temporary upgrade the lock to exclusive, call
vnode_pager_setsize(), by providing the nfsclient VOP_LOCK() implementation.

Tested by:	pho
Discussed with:	rmacklem
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D21883
2019-10-22 16:17:38 +00:00
..
nfs_commonacl.c
nfs_commonkrpc.c
nfs_commonport.c
nfs_commonsubs.c
nfs_var.h
nfs.h
nfscl.h
nfsclstate.h
nfsdport.h
nfskpiport.h
nfsm_subs.h
nfsport.h Fix interface between nfsclient and vnode pager. 2019-10-22 16:17:38 +00:00
nfsproto.h
nfsrvcache.h
nfsrvstate.h
nfsv4_errstr.h
rpcv2.h
xdr_subs.h