summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-10-31 16:49:18 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-10-31 16:49:18 +0000
commit0e2a177c4aaf118c132469ad9369ed1b18ba9220 (patch)
treeffe6cbfd39c910025cd7c744fee04ea3472e3735 /sys/kern/vfs_syscalls.c
parent50f4c62bcad2994f324c1fc3d9ebdfb363713a8b (diff)
checkdirs() walks allproc and calls sleeping functions if directories have
to be snapped. Change it so that everytime it sleeps it restarts from the top of the list. ok art
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index fee38c2fae1..021bd8414f9 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.149 2008/08/08 19:49:09 thib Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.150 2008/10/31 16:49:17 deraadt Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -330,17 +330,20 @@ checkdirs(struct vnode *olddp)
return;
if (VFS_ROOT(olddp->v_mountedhere, &newdp))
panic("mount: lost mount");
+again:
LIST_FOREACH(p, &allproc, p_list) {
fdp = p->p_fd;
if (fdp->fd_cdir == olddp) {
vrele(fdp->fd_cdir);
VREF(newdp);
fdp->fd_cdir = newdp;
+ goto again;
}
if (fdp->fd_rdir == olddp) {
vrele(fdp->fd_rdir);
VREF(newdp);
fdp->fd_rdir = newdp;
+ goto again;
}
}
if (rootvnode == olddp) {