Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs For update mounts the root vnode is already in u...



details:   https://anonhg.NetBSD.org/src/rev/75b78be81cc4
branches:  trunk
changeset: 760022:75b78be81cc4
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Fri Dec 24 13:38:57 2010 +0000

description:
For update mounts the root vnode is already in use and we must not
free it. Since the mount persists even when the update fails,
this is not a problem either.

diffstat:

 sys/ufs/ffs/ffs_wapbl.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (38 lines):

diff -r 666a47fcef1c -r 75b78be81cc4 sys/ufs/ffs/ffs_wapbl.c
--- a/sys/ufs/ffs/ffs_wapbl.c   Fri Dec 24 13:12:09 2010 +0000
+++ b/sys/ufs/ffs/ffs_wapbl.c   Fri Dec 24 13:38:57 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_wapbl.c,v 1.16 2010/12/23 14:43:37 mlelstv Exp $   */
+/*     $NetBSD: ffs_wapbl.c,v 1.17 2010/12/24 13:38:57 mlelstv Exp $   */
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.16 2010/12/23 14:43:37 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.17 2010/12/24 13:38:57 mlelstv Exp $");
 
 #define WAPBL_INTERNAL
 
@@ -608,13 +608,15 @@
        if ((error = VFS_ROOT(mp, &rvp)) != 0)
                return error;
 
-       if ((error = UFS_VALLOC(rvp, 0 | S_IFREG, NOCRED, &vp)) != 0) {
+       error = UFS_VALLOC(rvp, 0 | S_IFREG, NOCRED, &vp);
+       if (mp->mnt_flag & MNT_UPDATE) {
+               vput(rvp);
+       } else {
                VOP_UNLOCK(rvp);
                vgone(rvp);
+       }
+       if (error != 0)
                return error;
-       }
-       VOP_UNLOCK(rvp);
-       vgone(rvp);
 
        vp->v_type = VREG;
        ip = VTOI(vp);



Home | Main Index | Thread Index | Old Index