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 Drop unused 'p' argument to nfsv4_strtogid(). 2019-03-12 15:07:47 +00:00
nfs_commonkrpc.c Revert r320698, since the related userland changes were reverted by r338192. 2019-04-04 23:30:27 +00:00
nfs_commonport.c Add INET6 support for the upcalls to the nfsuserd daemon. 2019-04-06 21:53:46 +00:00
nfs_commonsubs.c Add #ifdef INET as requested by bz@. 2019-04-21 22:53:51 +00:00
nfs_var.h Delete the unused "nd" argument for nfsrv_checkdsattr(). 2019-09-04 22:37:28 +00:00
nfs.h Fix the NFSv4.0 server so that it does not support NFSv4.1 attributes. 2019-04-19 03:36:22 +00:00
nfscl.h sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00
nfsclstate.h Fix the pNFS client when mirrors aren't on the same machine. 2018-07-14 19:51:44 +00:00
nfsdport.h sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00
nfskpiport.h sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00
nfsm_subs.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
nfsport.h Fix interface between nfsclient and vnode pager. 2019-10-22 16:17:38 +00:00
nfsproto.h Add support for the ModeSetMasked attribute to the NFSv4.1 server. 2019-04-19 23:35:08 +00:00
nfsrvcache.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
nfsrvstate.h Add an optional feature to the pNFS server. 2018-07-02 19:21:33 +00:00
nfsv4_errstr.h sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00
rpcv2.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
xdr_subs.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00