summaryrefslogtreecommitdiff
path: root/sys/ntfs/ntfs_vfsops.c
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/ntfs/ntfs_vfsops.c
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/ntfs/ntfs_vfsops.c')
-rw-r--r--sys/ntfs/ntfs_vfsops.c12
1 files changed, 7 insertions, 5 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++)