freebsd-dev/sys/fs/nfsclient
Konstantin Belousov c6ba06d86c 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_clbio.c (4/6) Protect page valid with the busy lock. 2019-10-15 03:45:41 +00:00
nfs_clcomsubs.c Move four functions in nfscl.ko to nfscommon.ko. 2018-06-14 10:00:19 +00:00
nfs_clkdtrace.c sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00
nfs_clkrpc.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
nfs_clnfsiod.c Replace all mtx_assert() calls for n_mtx and ncl_iod_mutex with macros. 2019-09-26 02:54:45 +00:00
nfs_clnode.c Fix interface between nfsclient and vnode pager. 2019-10-22 16:17:38 +00:00
nfs_clport.c Fix interface between nfsclient and vnode pager. 2019-10-22 16:17:38 +00:00
nfs_clrpcops.c Replace all mtx_lock()/mtx_unlock() on n_mtx with the macros. 2019-09-24 01:58:54 +00:00
nfs_clstate.c Fix the NFSv4 client to safely find processes. 2019-04-15 01:27:15 +00:00
nfs_clsubs.c Fix interface between nfsclient and vnode pager. 2019-10-22 16:17:38 +00:00
nfs_clvfsops.c nfsclient: add root vnode caching 2019-10-06 22:17:29 +00:00
nfs_clvnops.c Fix interface between nfsclient and vnode pager. 2019-10-22 16:17:38 +00:00
nfs_kdtrace.h sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00
nfs.h Remove "struct ucred*" argument from vtruncbuf 2019-05-24 20:27:50 +00:00
nfsmount.h Move four functions in nfscl.ko to nfscommon.ko. 2018-06-14 10:00:19 +00: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