diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-09-10 20:57:05 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-09-10 20:57:05 +0000 |
commit | e58fc146313c511c51ba88774b1dcbfe0a60f35c (patch) | |
tree | 110a125724be74545ebdca9cec48770b7cd22b1e | |
parent | 7d9de83372070f04fcc3e32aeaf987a2df336851 (diff) |
Lock the vnode in ffs_unmount() before passing it too vinvalbuf()
and VOP_CLOSE() since both of them expected it too be locked.
ok art@
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 1279d3b85ef..1731d7f6d0d 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.110 2007/09/07 15:00:20 art Exp $ */ +/* $OpenBSD: ffs_vfsops.c,v 1.111 2007/09/10 20:57:04 thib Exp $ */ /* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */ /* @@ -1030,10 +1030,11 @@ 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); |