summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2003-05-05 00:21:53 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2003-05-05 00:21:53 +0000
commit45365e0c04c5d7d15388b0d65110e9e2e1a45b2e (patch)
tree4d68230c88047a764971bcbb83267dd539820f46 /sys/kern/vfs_syscalls.c
parentccf8df4e0c14b4ee5ce180805416576b8da9c56e (diff)
fix test for restoring mnt_syncer in dounmount.
ok and input csapuntz@
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 59a9fc7a9d4..d9283e3445e 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.101 2003/05/01 21:13:05 tedu Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.102 2003/05/05 00:21:52 tedu Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -437,18 +437,22 @@ dounmount(struct mount *mp, int flags, struct proc *p)
{
struct vnode *coveredvp;
int error;
+ int hadsyncer = 0;
mp->mnt_flag &=~ MNT_ASYNC;
cache_purgevfs(mp); /* remove cache entries for this file sys */
- if (mp->mnt_syncer != NULL)
+ if (mp->mnt_syncer != NULL) {
+ hadsyncer = 1;
vgone(mp->mnt_syncer);
+ mp->mnt_syncer = NULL;
+ }
if (((mp->mnt_flag & MNT_RDONLY) ||
(error = VFS_SYNC(mp, MNT_WAIT, p->p_ucred, p)) == 0) ||
(flags & MNT_FORCE))
error = VFS_UNMOUNT(mp, flags, p);
simple_lock(&mountlist_slock);
if (error) {
- if ((mp->mnt_flag & MNT_RDONLY) == 0 && mp->mnt_syncer == NULL)
+ if ((mp->mnt_flag & MNT_RDONLY) == 0 && hadsyncer)
(void) vfs_allocate_syncvnode(mp);
lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK,
&mountlist_slock, p);