Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/librump/rumpvfs Release etfs node's backing vnode b...
details: https://anonhg.NetBSD.org/src/rev/822d7959a193
branches: trunk
changeset: 760853:822d7959a193
user: pooka <pooka%NetBSD.org@localhost>
date: Fri Jan 14 11:07:42 2011 +0000
description:
Release etfs node's backing vnode before freeing the etfs node.
spotted from the LOCKDEBUG run that martin accidentally did
diffstat:
sys/rump/librump/rumpvfs/rumpfs.c | 24 +++++++++++++++++-------
1 files changed, 17 insertions(+), 7 deletions(-)
diffs (60 lines):
diff -r 7dabc90ffe35 -r 822d7959a193 sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Fri Jan 14 10:34:15 2011 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Fri Jan 14 11:07:42 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpfs.c,v 1.88 2011/01/13 10:26:47 pooka Exp $ */
+/* $NetBSD: rumpfs.c,v 1.89 2011/01/14 11:07:42 pooka Exp $ */
/*
* Copyright (c) 2009, 2010 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.88 2011/01/13 10:26:47 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.89 2011/01/14 11:07:42 pooka Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -213,6 +213,10 @@
struct vnode *rfsmp_rvp;
};
+#define INO_WHITEOUT 1
+static int lastino = 2;
+static kmutex_t reclock;
+
static struct rumpfs_node *makeprivate(enum vtype, dev_t, off_t, bool);
/*
@@ -478,8 +482,18 @@
mutex_exit(&etfs_lock);
/* node is unreachable, safe to nuke all device copies */
- if (et->et_blkmin != -1)
+ if (et->et_blkmin != -1) {
vdevgone(RUMPBLK_DEVMAJOR, et->et_blkmin, et->et_blkmin, VBLK);
+ } else {
+ struct vnode *vp;
+
+ mutex_enter(&reclock);
+ if ((vp = et->et_rn->rn_vp) != NULL)
+ mutex_enter(&vp->v_interlock);
+ mutex_exit(&reclock);
+ if (vp && vget(vp, 0) == 0)
+ vgone(vp);
+ }
if (et->et_rn->rn_hostpath != NULL)
free(et->et_rn->rn_hostpath, M_TEMP);
@@ -493,10 +507,6 @@
* rumpfs
*/
-#define INO_WHITEOUT 1
-static int lastino = 2;
-static kmutex_t reclock;
-
static struct rumpfs_node *
makeprivate(enum vtype vt, dev_t rdev, off_t size, bool et)
{
Home |
Main Index |
Thread Index |
Old Index