Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Assert that a VI_CLEAN vnode is not succesfully vge...



details:   https://anonhg.NetBSD.org/src/rev/ebe468cd83dc
branches:  trunk
changeset: 755205:ebe468cd83dc
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu May 27 23:54:35 2010 +0000

description:
Assert that a VI_CLEAN vnode is not succesfully vget'd.

diffstat:

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

diffs (42 lines):

diff -r bf5bcfa8a9f7 -r ebe468cd83dc sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c       Thu May 27 23:40:12 2010 +0000
+++ b/sys/kern/vfs_subr.c       Thu May 27 23:54:35 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_subr.c,v 1.401 2010/05/24 03:50:25 pgoyette Exp $  */
+/*     $NetBSD: vfs_subr.c,v 1.402 2010/05/27 23:54:35 pooka Exp $     */
 
 /*-
  * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.401 2010/05/24 03:50:25 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.402 2010/05/27 23:54:35 pooka Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -1286,7 +1286,7 @@
 int
 vget(vnode_t *vp, int flags)
 {
-       int error;
+       int error = 0;
 
        KASSERT((vp->v_iflag & VI_MARKER) == 0);
 
@@ -1340,10 +1340,11 @@
                if (error != 0) {
                        vrele(vp);
                }
-               return error;
+       } else {
+               mutex_exit(&vp->v_interlock);
        }
-       mutex_exit(&vp->v_interlock);
-       return 0;
+       KASSERT(error || (vp->v_iflag & VI_CLEAN) == 0);
+       return error;
 }
 
 /*



Home | Main Index | Thread Index | Old Index