summaryrefslogtreecommitdiff
path: root/sys/dev/vnd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2011-04-23 14:57:02 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2011-04-23 14:57:02 +0000
commit4dd7822ec3f2d538c4ddc4c10ac82969174a9bc1 (patch)
tree30fbb00e899abb84f5f3effe029c420cb492e857 /sys/dev/vnd.c
parent038238da93cb39f6364369159a0c62ef2b97579b (diff)
backout the miod change since it is wrong
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r--sys/dev/vnd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index fc156d4deeb..917913d1b42 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.110 2011/04/22 21:28:56 miod Exp $ */
+/* $OpenBSD: vnd.c,v 1.111 2011/04/23 14:57:01 deraadt Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -226,11 +226,9 @@ vndopen(dev_t dev, int flags, int mode, struct proc *p)
part = DISKPART(dev);
pmask = 1 << part;
- /*
- * If any partition is open, all succeeding openings must be of the
- * same type or read-only.
- */
- if (sc->sc_dk.dk_openmask && (flags & FWRITE)) {
+ /* Allow access to the raw device even if we are open. */
+ if (sc->sc_dk.dk_openmask && !(part == RAW_PART) &&
+ !(mode == S_IFCHR)) {
error = EBUSY;
goto bad;
}