summaryrefslogtreecommitdiff
path: root/sys/msdosfs/msdosfs_vfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/msdosfs/msdosfs_vfsops.c')
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index 1bf90685d14..42945651bd0 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/msdosfs/msdosfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_vfsops.c,v 1.37 2006/07/19 15:48:06 sturm Exp $ */
+/* $OpenBSD: msdosfs_vfsops.c,v 1.38 2006/08/06 18:42:01 thib Exp $ */
/* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */
/*-
@@ -593,7 +593,9 @@ error_exit:
devvp->v_specmountpoint = NULL;
if (bp)
brelse(bp);
+ vn_lock(devvp, LK_EXCLUSIVE|LK_RETRY, p);
(void) VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
+ VOP_UNLOCK(devvp, 0, p);
if (pmp) {
if (pmp->pm_inusemap)
free(pmp->pm_inusemap, M_MSDOSFSFAT);
@@ -639,9 +641,11 @@ msdosfs_unmount(mp, mntflags, p)
#ifdef MSDOSFS_DEBUG
vprint("msdosfs_umount(): just before calling VOP_CLOSE()\n", vp);
#endif
+ vn_lock(vp, LK_EXCLUSIVE|LK_RETRY, p);
error = VOP_CLOSE(vp,
pmp->pm_flags & MSDOSFSMNT_RONLY ? FREAD : FREAD|FWRITE, NOCRED, p);
- vrele(vp);
+ vput(vp);
+
free(pmp->pm_inusemap, M_MSDOSFSFAT);
free(pmp, M_MSDOSFSMNT);
mp->mnt_data = (qaddr_t)0;