Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/kern Pull up following revision(s) (requested by hann...
details: https://anonhg.NetBSD.org/src/rev/8b6f4857efbe
branches: netbsd-7
changeset: 798448:8b6f4857efbe
user: martin <martin%NetBSD.org@localhost>
date: Sun Oct 19 10:02:59 2014 +0000
description:
Pull up following revision(s) (requested by hannken in ticket #150):
sys/kern/vfs_vnode.c: revision 1.39
When creating a vnode with vcache_get() mark the vnode VI_CHANGING until
it is fully initialised. It may be on the specnode list before it is
fully initialised and revoking it then would panic.
Should prevent the panic from PR kern/49171 (panic when closing a pty).
diffstat:
sys/kern/vfs_vnode.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (37 lines):
diff -r 3af3f24658a0 -r 8b6f4857efbe sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c Sun Oct 19 09:15:59 2014 +0000
+++ b/sys/kern/vfs_vnode.c Sun Oct 19 10:02:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnode.c,v 1.37 2014/07/05 09:33:15 hannken Exp $ */
+/* $NetBSD: vfs_vnode.c,v 1.37.2.1 2014/10/19 10:02:59 martin Exp $ */
/*-
* Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.37 2014/07/05 09:33:15 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.37.2.1 2014/10/19 10:02:59 martin Exp $");
#define _VFS_VNODE_PRIVATE
@@ -1292,6 +1292,7 @@
}
/* Load the fs node. Exclusive as new_node->vn_vnode is NULL. */
+ vp->v_iflag |= VI_CHANGING;
error = VFS_LOADVNODE(mp, vp, key, key_len, &new_key);
if (error) {
mutex_enter(&vcache.lock);
@@ -1319,6 +1320,10 @@
new_node->vn_key.vk_key = new_key;
new_node->vn_vnode = vp;
mutex_exit(&vcache.lock);
+ mutex_enter(vp->v_interlock);
+ vp->v_iflag &= ~VI_CHANGING;
+ cv_broadcast(&vp->v_cv);
+ mutex_exit(vp->v_interlock);
*vpp = vp;
return 0;
}
Home |
Main Index |
Thread Index |
Old Index