From 024c36f64b111dffef95cce2fce9d452aea59564 Mon Sep 17 00:00:00 2001 From: ad Date: Sun, 14 Dec 2008 11:15:59 +0000 Subject: [PATCH] vclean: be paranoid and set v_tag, v_op while holding v_interlock. FS code could check their values while scrolling through mnt_vnodelist. --- sys/kern/vfs_subr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index db673a6b329c..30a3218594f9 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_subr.c,v 1.359 2008/12/14 11:13:36 ad Exp $ */ +/* $NetBSD: vfs_subr.c,v 1.360 2008/12/14 11:15:59 ad Exp $ */ /*- * Copyright (c) 1997, 1998, 2004, 2005, 2007, 2008 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.359 2008/12/14 11:13:36 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.360 2008/12/14 11:15:59 ad Exp $"); #include "opt_ddb.h" #include "opt_compat_netbsd.h" @@ -1841,9 +1841,9 @@ vclean(vnode_t *vp, int flags) cache_purge(vp); /* Done with purge, notify sleepers of the grim news. */ + mutex_enter(&vp->v_interlock); vp->v_op = dead_vnodeop_p; vp->v_tag = VT_NON; - mutex_enter(&vp->v_interlock); vp->v_vnlock = &vp->v_lock; KNOTE(&vp->v_klist, NOTE_REVOKE); vp->v_iflag &= ~(VI_XLOCK | VI_FREEING);