Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2]: src/sys/kern Pull up following revision(s) (requested by pook...



details:   https://anonhg.NetBSD.org/src/rev/2aae0c18ecb3
branches:  netbsd-2
changeset: 564603:2aae0c18ecb3
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sat Aug 11 13:58:23 2007 +0000

description:
Pull up following revision(s) (requested by pooka in ticket #11340):
        sys/kern/vfs_subr.c: revision 1.289
Don't drain a vnode's lock when we are cleaning it out.  It still
might be used by upper layers in the vnode stack due to exported
lock pointers.  This introduces no difference to the normal case
and works around a problem where a lower layer vnode is cleaned
out before the upper layer due to forced unmount or revoke.  And
for cosmetics, set a vnode's lock export to NULL when it is cleaned
out.
per discussion with Bill Stouder-Studenmund on tech-kern

diffstat:

 sys/kern/vfs_subr.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (45 lines):

diff -r 7e9f5b716965 -r 2aae0c18ecb3 sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c       Mon Jun 04 19:27:14 2007 +0000
+++ b/sys/kern/vfs_subr.c       Sat Aug 11 13:58:23 2007 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_subr.c,v 1.218.2.4.2.1 2005/12/29 01:37:06 riz Exp $       */
+/*     $NetBSD: vfs_subr.c,v 1.218.2.4.2.2 2007/08/11 13:58:23 bouyer Exp $    */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.218.2.4.2.1 2005/12/29 01:37:06 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.218.2.4.2.2 2007/08/11 13:58:23 bouyer Exp $");
 
 #include "opt_inet.h"
 #include "opt_ddb.h"
@@ -1603,12 +1603,14 @@
 
        /*
         * Even if the count is zero, the VOP_INACTIVE routine may still
-        * have the object locked while it cleans it out. The VOP_LOCK
-        * ensures that the VOP_INACTIVE routine is done with its work.
-        * For active vnodes, it ensures that no other activity can
+        * have the object locked while it cleans it out.  For
+        * active vnodes, it ensures that no other activity can
         * occur while the underlying object is being cleaned out.
+        *
+        * We don't drain the lock because it might have been exported
+        * to upper layers by this vnode and could still be in use.
         */
-       VOP_LOCK(vp, LK_DRAIN | LK_INTERLOCK);
+       VOP_LOCK(vp, LK_EXCLUSIVE | LK_INTERLOCK);
 
        /*
         * Clean out any cached data associated with the vnode.
@@ -1728,6 +1730,7 @@
         */
        vp->v_op = dead_vnodeop_p;
        vp->v_tag = VT_NON;
+       vp->v_vnlock = NULL;
        simple_lock(&vp->v_interlock);
        VN_KNOTE(vp, NOTE_REVOKE);      /* FreeBSD has this in vn_pollgone() */
        vp->v_flag &= ~VXLOCK;



Home | Main Index | Thread Index | Old Index