Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Remove the test for mounted-on block devices in vcl...
details: https://anonhg.NetBSD.org/src/rev/db2e44894f33
branches: trunk
changeset: 339038:db2e44894f33
user: hannken <hannken%NetBSD.org@localhost>
date: Tue Jun 23 10:40:36 2015 +0000
description:
Remove the test for mounted-on block devices in vclean() and
always close the vnode here.
A forced unmount of a file system holding a mounted-on
block device will make this mounted-on file system unusable.
diffstat:
sys/kern/vfs_vnode.c | 41 ++++++++++++++++-------------------------
1 files changed, 16 insertions(+), 25 deletions(-)
diffs (83 lines):
diff -r b7c57a5a2993 -r db2e44894f33 sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c Tue Jun 23 10:00:13 2015 +0000
+++ b/sys/kern/vfs_vnode.c Tue Jun 23 10:40:36 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_vnode.c,v 1.42 2015/04/20 19:36:55 riastradh Exp $ */
+/* $NetBSD: vfs_vnode.c,v 1.43 2015/06/23 10:40:36 hannken Exp $ */
/*-
* Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -116,7 +116,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.42 2015/04/20 19:36:55 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.43 2015/06/23 10:40:36 hannken Exp $");
#define _VFS_VNODE_PRIVATE
@@ -956,7 +956,7 @@
vclean(vnode_t *vp)
{
lwp_t *l = curlwp;
- bool recycle, active, doclose;
+ bool recycle, active;
int error;
KASSERT(mutex_owned(vp->v_interlock));
@@ -969,8 +969,6 @@
}
active = (vp->v_usecount > 1);
- doclose = ! (active && vp->v_type == VBLK &&
- spec_node_getmountedfs(vp) != NULL);
mutex_exit(vp->v_interlock);
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
@@ -995,18 +993,16 @@
* deactivated before being reclaimed. Note that the
* VOP_INACTIVE will unlock the vnode.
*/
- if (doclose) {
- error = vinvalbuf(vp, V_SAVE, NOCRED, l, 0, 0);
- if (error != 0) {
- if (wapbl_vphaswapbl(vp))
- WAPBL_DISCARD(wapbl_vptomp(vp));
- error = vinvalbuf(vp, 0, NOCRED, l, 0, 0);
- }
- KASSERT(error == 0);
- KASSERT((vp->v_iflag & VI_ONWORKLST) == 0);
- if (active && (vp->v_type == VBLK || vp->v_type == VCHR)) {
- spec_node_revoke(vp);
- }
+ error = vinvalbuf(vp, V_SAVE, NOCRED, l, 0, 0);
+ if (error != 0) {
+ if (wapbl_vphaswapbl(vp))
+ WAPBL_DISCARD(wapbl_vptomp(vp));
+ error = vinvalbuf(vp, 0, NOCRED, l, 0, 0);
+ }
+ KASSERT(error == 0);
+ KASSERT((vp->v_iflag & VI_ONWORKLST) == 0);
+ if (active && (vp->v_type == VBLK || vp->v_type == VCHR)) {
+ spec_node_revoke(vp);
}
if (active) {
VOP_INACTIVE(vp, &recycle);
@@ -1041,14 +1037,9 @@
/* Done with purge, notify sleepers of the grim news. */
mutex_enter(vp->v_interlock);
- if (doclose) {
- vp->v_op = dead_vnodeop_p;
- vp->v_vflag |= VV_LOCKSWORK;
- vp->v_iflag |= VI_CLEAN;
- } else {
- vp->v_op = spec_vnodeop_p;
- vp->v_vflag &= ~VV_LOCKSWORK;
- }
+ vp->v_op = dead_vnodeop_p;
+ vp->v_vflag |= VV_LOCKSWORK;
+ vp->v_iflag |= VI_CLEAN;
vp->v_tag = VT_NON;
KNOTE(&vp->v_klist, NOTE_REVOKE);
vp->v_iflag &= ~VI_XLOCK;
Home |
Main Index |
Thread Index |
Old Index