summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2018-06-14 00:23:37 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2018-06-14 00:23:37 +0000
commit4cfd7245b7a45b539993b58cdd0ef1518f471b8b (patch)
tree0864cba9b532532d5e03f470c03af1c2a4e749c5 /sys/kern
parentb1a388b2594b03a5b9d9f4c23765229758b6d85b (diff)
In dounlinkat() only perform the check for a mounted directory when
actually removing a directory. Fixes a problem where removing device special files could result in EBUSY. OK guenther@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_syscalls.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 82914681da8..4d4c3364124 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.288 2018/06/13 14:57:24 visa Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.289 2018/06/14 00:23:36 millert Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -1568,14 +1568,13 @@ dounlinkat(struct proc *p, int fd, const char *path, int flag)
error = EINVAL;
goto out;
}
- }
-
- /*
- * A mounted on directory cannot be deleted.
- */
- if (vp->v_mountedhere != NULL) {
- error = EBUSY;
- goto out;
+ /*
+ * A mounted on directory cannot be deleted.
+ */
+ if (vp->v_mountedhere != NULL) {
+ error = EBUSY;
+ goto out;
+ }
}
/*