Hi, The 4th parameter olddp of dounmount() is not used. It was added here
---------------------------- revision 1.103 date: 2003/05/06 20:52:14; author: tedu; state: Exp; lines: +28 -4; attempt to put a process's cwd back in place after a forced umount. won't always work, but it's the best we can do for now. this covers at least some of the failure cases the previous commit to vfs_lookup.c checks for. ok weingart@ ---------------------------- But forgotten to remove here ---------------------------- revision 1.117 date: 2004/08/05 04:46:26; author: tedu; state: Exp; lines: +1 -25; don't attempt to put processes back in a directory after unmount. it could never always work, and worse, may cause other bugs/crashes. ---------------------------- ok to delete olddp? bluhm Index: kern/vfs_default.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/kern/vfs_default.c,v retrieving revision 1.42 diff -u -p -r1.42 vfs_default.c --- kern/vfs_default.c 12 Mar 2016 00:27:15 -0000 1.42 +++ kern/vfs_default.c 10 Jan 2017 16:48:30 -0000 @@ -76,7 +76,7 @@ vop_generic_revoke(void *v) * point laying around in VFS. */ if (!vfs_busy(mp, VB_WRITE|VB_WAIT)) { - dounmount(mp, MNT_FORCE | MNT_DOOMED, p, NULL); + dounmount(mp, MNT_FORCE | MNT_DOOMED, p); break; } } Index: kern/vfs_subr.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/kern/vfs_subr.c,v retrieving revision 1.254 diff -u -p -r1.254 vfs_subr.c --- kern/vfs_subr.c 28 Sep 2016 22:22:52 -0000 1.254 +++ kern/vfs_subr.c 10 Jan 2017 16:48:35 -0000 @@ -1578,7 +1578,7 @@ vfs_unmountall(void) TAILQ_FOREACH_REVERSE_SAFE(mp, &mountlist, mntlist, mnt_list, nmp) { if ((vfs_busy(mp, VB_WRITE|VB_NOWAIT)) != 0) continue; - if ((error = dounmount(mp, MNT_FORCE, curproc, NULL)) != 0) { + if ((error = dounmount(mp, MNT_FORCE, curproc)) != 0) { printf("unmount of %s failed with error %d\n", mp->mnt_stat.f_mntonname, error); allerror = 1; Index: kern/vfs_syscalls.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/kern/vfs_syscalls.c,v retrieving revision 1.265 diff -u -p -r1.265 vfs_syscalls.c --- kern/vfs_syscalls.c 10 Sep 2016 16:53:30 -0000 1.265 +++ kern/vfs_syscalls.c 10 Jan 2017 16:47:09 -0000 @@ -365,14 +365,14 @@ sys_unmount(struct proc *p, void *v, reg if (vfs_busy(mp, VB_WRITE|VB_WAIT)) return (EBUSY); - return (dounmount(mp, SCARG(uap, flags) & MNT_FORCE, p, vp)); + return (dounmount(mp, SCARG(uap, flags) & MNT_FORCE, p)); } /* * Do the actual file system unmount. */ int -dounmount(struct mount *mp, int flags, struct proc *p, struct vnode *olddp) +dounmount(struct mount *mp, int flags, struct proc *p) { struct vnode *coveredvp; int error; Index: miscfs/fuse/fuse_device.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/miscfs/fuse/fuse_device.c,v retrieving revision 1.21 diff -u -p -r1.21 fuse_device.c --- miscfs/fuse/fuse_device.c 30 Aug 2016 16:45:54 -0000 1.21 +++ miscfs/fuse/fuse_device.c 10 Jan 2017 16:50:45 -0000 @@ -270,8 +270,8 @@ fuseclose(dev_t dev, int flags, int fmt, fd->fd_fmp->sess_init = 0; if ((vfs_busy(fd->fd_fmp->mp, VB_WRITE|VB_NOWAIT)) != 0) goto end; - if ((error = dounmount(fd->fd_fmp->mp, MNT_FORCE, curproc, - NULL)) != 0) + error = dounmount(fd->fd_fmp->mp, MNT_FORCE, curproc); + if (error) printf("fuse: unmount failed with error %d\n", error); fd->fd_fmp = NULL; } Index: sys/mount.h =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/sys/mount.h,v retrieving revision 1.127 diff -u -p -r1.127 mount.h --- sys/mount.h 10 Sep 2016 16:53:30 -0000 1.127 +++ sys/mount.h 10 Jan 2017 16:48:44 -0000 @@ -602,7 +602,7 @@ int speedup_syncer(void); int vfs_syncwait(int); /* sync and wait for complete */ void vfs_shutdown(void); /* unmount and sync file systems */ -int dounmount(struct mount *, int, struct proc *, struct vnode *); +int dounmount(struct mount *, int, struct proc *); void vfsinit(void); int vfs_register(struct vfsconf *); int vfs_unregister(struct vfsconf *); Index: ufs/mfs/mfs_vfsops.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/ufs/mfs/mfs_vfsops.c,v retrieving revision 1.53 diff -u -p -r1.53 mfs_vfsops.c --- ufs/mfs/mfs_vfsops.c 7 Nov 2016 00:26:33 -0000 1.53 +++ ufs/mfs/mfs_vfsops.c 10 Jan 2017 16:49:24 -0000 @@ -195,7 +195,7 @@ mfs_start(struct mount *mp, int flags, s if (sleepreturn != 0) { if (vfs_busy(mp, VB_WRITE|VB_NOWAIT) || dounmount(mp, - (CURSIG(p) == SIGKILL) ? MNT_FORCE : 0, p, NULL)) + (CURSIG(p) == SIGKILL) ? MNT_FORCE : 0, p)) CLRSIG(p, CURSIG(p)); sleepreturn = 0; continue;