summaryrefslogtreecommitdiffstats
path: root/sys/nfs
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2013-11-27 16:02:54 +0000
committerjsing <jsing@openbsd.org>2013-11-27 16:02:54 +0000
commit0906007ed789e595e8db45120ae43803822e9aab (patch)
treed21c0e49808fdb888825f66c9782bffc021f5a6c /sys/nfs
parentDefer the v_type initialisation until after the vnode has been purged from (diff)
downloadwireguard-openbsd-0906007ed789e595e8db45120ae43803822e9aab.tar.xz
wireguard-openbsd-0906007ed789e595e8db45120ae43803822e9aab.zip
If the v_type is going to change when loading the NFS attribute cache,
purge the vnode from the namecache first. This prevents cache_purge() from later getting confused and trying to cache_zap() a namecache entry multiple times over, due to cache_zap() believing that the entry does not need to be removed from the vnode destinations queue. ok beck@
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_subs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c
index d76c8dcadbf..0dad3f82628 100644
--- a/sys/nfs/nfs_subs.c
+++ b/sys/nfs/nfs_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_subs.c,v 1.114 2013/08/13 05:52:25 guenther Exp $ */
+/* $OpenBSD: nfs_subs.c,v 1.115 2013/11/27 16:02:54 jsing Exp $ */
/* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */
/*
@@ -991,6 +991,7 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp,
*/
np = VTONFS(vp);
if (vp->v_type != vtyp) {
+ cache_purge(vp);
vp->v_type = vtyp;
if (vp->v_type == VFIFO) {
#ifndef FIFO