Source-Changes-HG archive

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

[src/trunk]: src/sys/kern vfs_vnode_iterator_next(): if a vnode is reclaiming...



details:   https://anonhg.NetBSD.org/src/rev/4192bdf39844
branches:  trunk
changeset: 796361:4192bdf39844
user:      hannken <hannken%NetBSD.org@localhost>
date:      Fri May 30 08:46:00 2014 +0000

description:
vfs_vnode_iterator_next(): if a vnode is reclaiming (VI_XLOCK) skip
the filter.  Vget() will wait until the vnode disappeared.  No more
"dangling vnode" panics on unmount.

diffstat:

 sys/kern/vfs_mount.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (30 lines):

diff -r e72acf63d980 -r 4192bdf39844 sys/kern/vfs_mount.c
--- a/sys/kern/vfs_mount.c      Fri May 30 08:42:35 2014 +0000
+++ b/sys/kern/vfs_mount.c      Fri May 30 08:46:00 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_mount.c,v 1.29 2014/05/24 16:34:04 christos Exp $  */
+/*     $NetBSD: vfs_mount.c,v 1.30 2014/05/30 08:46:00 hannken Exp $   */
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.29 2014/05/24 16:34:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.30 2014/05/30 08:46:00 hannken Exp $");
 
 #define _VFS_VNODE_PRIVATE
 
@@ -393,9 +393,8 @@
                        return NULL;
                }
                mutex_enter(vp->v_interlock);
-               while (ISSET(vp->v_iflag, VI_MARKER) ||
-                   ISSET(vp->v_iflag, VI_XLOCK) ||
-                   (f && !(*f)(cl, vp))) {
+               if (ISSET(vp->v_iflag, VI_MARKER) ||
+                   (f && !ISSET(vp->v_iflag, VI_XLOCK) && !(*f)(cl, vp))) {
                        mutex_exit(vp->v_interlock);
                        vp = TAILQ_NEXT(vp, v_mntvnodes);
                        goto again;



Home | Main Index | Thread Index | Old Index