Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/432a3e023775
branches:  netbsd-2
changeset: 564404:432a3e023775
user:      riz <riz%NetBSD.org@localhost>
date:      Fri Jan 06 23:53:26 2006 +0000

description:
Pull up following revision(s) (requested by wrstuden in ticket #10213):
        sys/fs/union/union_vfsops.c: revision 1.32 via patch
Change union_unmount() to not play with the fs root vnode explicitly.
Let it get recycled along with all of the others. This is important
as if the root vnode has already been reclaimed, then we get a panic
when we try to vget it.
This addresses PR: kern/31382

diffstat:

 sys/fs/union/union_vfsops.c |  30 ++++--------------------------
 1 files changed, 4 insertions(+), 26 deletions(-)

diffs (80 lines):

diff -r 6499182bf59c -r 432a3e023775 sys/fs/union/union_vfsops.c
--- a/sys/fs/union/union_vfsops.c       Thu Jan 05 22:40:14 2006 +0000
+++ b/sys/fs/union/union_vfsops.c       Fri Jan 06 23:53:26 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: union_vfsops.c,v 1.11.2.1 2004/05/29 09:04:14 tron Exp $       */
+/*     $NetBSD: union_vfsops.c,v 1.11.2.1.2.1 2006/01/06 23:53:26 riz Exp $    */
 
 /*
  * Copyright (c) 1994 The Regents of the University of California.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.11.2.1 2004/05/29 09:04:14 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.11.2.1.2.1 2006/01/06 23:53:26 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -338,17 +338,12 @@
        struct proc *p;
 {
        struct union_mount *um = MOUNTTOUNIONMOUNT(mp);
-       struct vnode *um_rootvp;
-       int error;
        int freeing;
 
 #ifdef UNION_DIAGNOSTIC
        printf("union_unmount(mp = %p)\n", mp);
 #endif
 
-       if ((error = union_root(mp, &um_rootvp)) != 0)
-               return (error);
-
        /*
         * Keep flushing vnodes from the mount list.
         * This is needed because of the un_pvp held
@@ -358,7 +353,7 @@
         * (d) times, where (d) is the maximum tree depth
         * in the filesystem.
         */
-       for (freeing = 0; vflush(mp, um_rootvp, 0) != 0;) {
+       for (freeing = 0; vflush(mp, NULL, 0) != 0;) {
                struct vnode *vp;
                int n;
 
@@ -381,18 +376,9 @@
         */
 
        if (mntflags & MNT_FORCE)
-               vflush(mp, um_rootvp, FORCECLOSE);
-       
+               vflush(mp, NULL, FORCECLOSE);
 
-       /* At this point the root vnode should have a single reference */
-       if (um_rootvp->v_usecount > 1) {
-               vput(um_rootvp);
-               return (EBUSY);
-       }
 
-#ifdef UNION_DIAGNOSTIC
-       vprint("union root", um_rootvp);
-#endif  
        /*
         * Discard references to upper and lower target vnodes.
         */
@@ -401,14 +387,6 @@
        vrele(um->um_uppervp);
        crfree(um->um_cred);
        /*
-        * Release reference on underlying root vnode
-        */
-       vput(um_rootvp);
-       /*
-        * And blow it away for future re-use
-        */
-       vgone(um_rootvp);
-       /*
         * Finally, throw away the union_mount structure
         */
        free(mp->mnt_data, M_UFSMNT);   /* XXX */



Home | Main Index | Thread Index | Old Index