diff options
author | ps <ps@FreeBSD.org> | 2004-12-06 18:52:28 +0000 |
---|---|---|
committer | ps <ps@FreeBSD.org> | 2004-12-06 18:52:28 +0000 |
commit | aa4aa62af0e8c0c4f728c9ba05822f4f444bae04 (patch) | |
tree | 5ec68719ae470095ad69494b676752ed2b3bd3a1 /sys/nfsclient/nfs_node.c | |
parent | f98e4c8a08da099c561a33440e4f624e79c99314 (diff) | |
download | FreeBSD-src-aa4aa62af0e8c0c4f728c9ba05822f4f444bae04.zip FreeBSD-src-aa4aa62af0e8c0c4f728c9ba05822f4f444bae04.tar.gz |
Serialize NFS vinvalbuf operations by acquiring/upgrading to the
vnode EXCLUSIVE lock. This prevents threads from adding pages to
the vnode while an invalidation is in progress, closing potential
races. In the bioread() path, callers acquire the SHARED vnode lock
- so while an invalidate was in progress, it was possible to fault
in new pages onto the vnode causing the invalidation to take a while
or fail. We saw these races at Yahoo! with very large files+heavy
concurrent access. Forcing an upgrade to EXCLUSIVE lock before doing
the invalidation closes all these races.
Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
Diffstat (limited to 'sys/nfsclient/nfs_node.c')
-rw-r--r-- | sys/nfsclient/nfs_node.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c index 60ced4f..59dde27 100644 --- a/sys/nfsclient/nfs_node.c +++ b/sys/nfsclient/nfs_node.c @@ -315,7 +315,7 @@ nfs_inactive(struct vop_inactive_args *ap) vrele(sp->s_dvp); FREE((caddr_t)sp, M_NFSREQ); } - np->n_flag &= (NMODIFIED | NFLUSHINPROG | NFLUSHWANT); + np->n_flag &= NMODIFIED; VOP_UNLOCK(ap->a_vp, 0, ap->a_td); return (0); } |