summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs/ffs_vfsops.c
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2006-08-06 18:42:02 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2006-08-06 18:42:02 +0000
commit86b0e9841c734d03c0061a08c6defcd360133f65 (patch)
tree0934a3c5c967aacd5db1309cd537b488566addec /sys/ufs/ffs/ffs_vfsops.c
parentaea23d2253246c3537bcfc024f98ae378b87f0e7 (diff)
obey the locking disaplince wrt to VOP_CLOSE during umounts
and mount error paths. ok sturm@ pedro@
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 7729df1320f..101498d00e6 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vfsops.c,v 1.94 2006/06/17 16:30:58 miod Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.95 2006/08/06 18:42:01 thib Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
@@ -898,7 +898,9 @@ out:
devvp->v_specmountpoint = NULL;
if (bp)
brelse(bp);
+ vn_lock(devvp, LK_EXCLUSIVE|LK_RETRY, p);
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, cred, p);
+ VOP_UNLOCK(devvp, 0, p);
if (ump) {
free(ump->um_fs, M_UFSMNT);
free(ump, M_UFSMNT);
@@ -972,10 +974,12 @@ ffs_unmount(struct mount *mp, int mntflags, struct proc *p)
}
ump->um_devvp->v_specmountpoint = NULL;
+ vn_lock(ump->um_devvp, LK_EXCLUSIVE|LK_RETRY, p);
vinvalbuf(ump->um_devvp, V_SAVE, NOCRED, p, 0, 0);
error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE,
NOCRED, p);
- vrele(ump->um_devvp);
+ vput(ump->um_devvp);
+
free(fs->fs_csp, M_UFSMNT);
free(fs, M_UFSMNT);
free(ump, M_UFSMNT);