summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2011-12-20 09:13:08 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2011-12-20 09:13:08 +0000
commit8e418f7d9be65e0c4a29c35bb109f2c47955619e (patch)
tree24a83170fc8c37600af586c536899669a0d033e3 /sys
parent84fe85e63ee8ba469ef1c64feb5bc9d5c326b572 (diff)
respect the MNT_FORCE flag in ntfs_unmount and proceed even if there's
someone holding a system vnode. prevents crashes with forced unmounts. silence ntfs_reclaim so that kernel won't spit out vprint's angrily. ok krw, beck
Diffstat (limited to 'sys')
-rw-r--r--sys/ntfs/ntfs_vfsops.c12
-rw-r--r--sys/ntfs/ntfs_vnops.c4
2 files changed, 9 insertions, 7 deletions
diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c
index 29b85366cc5..722f2a50db6 100644
--- a/sys/ntfs/ntfs_vfsops.c
+++ b/sys/ntfs/ntfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vfsops.c,v 1.27 2011/07/04 20:35:35 deraadt Exp $ */
+/* $OpenBSD: ntfs_vfsops.c,v 1.28 2011/12/20 09:13:07 mikeb Exp $ */
/* $NetBSD: ntfs_vfsops.c,v 1.7 2003/04/24 07:50:19 christos Exp $ */
/*-
@@ -547,10 +547,12 @@ ntfs_unmount(
return (error);
}
- /* Check if only system vnodes are rest */
- for(i=0;i<NTFS_SYSNODESNUM;i++)
- if((ntmp->ntm_sysvn[i]) &&
- (ntmp->ntm_sysvn[i]->v_usecount > 1)) return (EBUSY);
+ /* Check if system vnodes are still referenced */
+ for(i=0;i<NTFS_SYSNODESNUM;i++) {
+ if(((mntflags & MNT_FORCE) == 0) && (ntmp->ntm_sysvn[i] &&
+ ntmp->ntm_sysvn[i]->v_usecount > 1))
+ return (EBUSY);
+ }
/* Dereference all system vnodes */
for(i=0;i<NTFS_SYSNODESNUM;i++)
diff --git a/sys/ntfs/ntfs_vnops.c b/sys/ntfs/ntfs_vnops.c
index 3acd2e00968..1fda6400cd4 100644
--- a/sys/ntfs/ntfs_vnops.c
+++ b/sys/ntfs/ntfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vnops.c,v 1.24 2011/07/04 20:35:35 deraadt Exp $ */
+/* $OpenBSD: ntfs_vnops.c,v 1.25 2011/12/20 09:13:07 mikeb Exp $ */
/* $NetBSD: ntfs_vnops.c,v 1.6 2003/04/10 21:57:26 jdolecek Exp $ */
/*
@@ -72,7 +72,7 @@ static int ntfs_bmap(void *);
static int ntfs_fsync(void *);
static int ntfs_pathconf(void *);
-int ntfs_prtactive = 1; /* 1 => print out reclaim of active vnodes */
+int ntfs_prtactive = 0; /* 1 => print out reclaim of active vnodes */
/*
* This is a noop, simply returning what one has been given.