Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/4f2914343a04
branches:  netbsd-3
changeset: 577695:4f2914343a04
user:      riz <riz%NetBSD.org@localhost>
date:      Sun Jan 08 15:45:11 2006 +0000

description:
Pull up following revision(s) (requested by wrstuden in ticket #1091):
        sys/fs/union/union_vfsops.c: revision 1.32
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 f9c048eeccd4 -r 4f2914343a04 sys/fs/union/union_vfsops.c
--- a/sys/fs/union/union_vfsops.c       Thu Jan 05 22:31:05 2006 +0000
+++ b/sys/fs/union/union_vfsops.c       Sun Jan 08 15:45:11 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: union_vfsops.c,v 1.25.2.1 2005/08/28 09:58:59 tron Exp $       */
+/*     $NetBSD: union_vfsops.c,v 1.25.2.2 2006/01/08 15:45:11 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.25.2.1 2005/08/28 09:58:59 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.25.2.2 2006/01/08 15:45:11 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -339,17 +339,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
@@ -359,7 +354,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;
 
@@ -382,18 +377,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.
         */
@@ -402,14 +388,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