summaryrefslogtreecommitdiff
path: root/sys/dev/vnd.c
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2006-10-05 18:29:27 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2006-10-05 18:29:27 +0000
commita068471b5938047c9744103d90a44b75fe8e9fe2 (patch)
tree18189208b8abde5e6f5685efce1b9a9d33892897 /sys/dev/vnd.c
parent6a1a52000f75cbf26a414a339c5eba148fb734dd (diff)
Always allow read-only opens on (s)vnd devices, despite the
type of the first open (svnd vs vnd). ok pedro@
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r--sys/dev/vnd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index ee199b83748..260f22b706e 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.64 2006/10/03 19:49:06 pedro Exp $ */
+/* $OpenBSD: vnd.c,v 1.65 2006/10/05 18:29:26 thib Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -253,11 +253,11 @@ vndopen(dev, flags, mode, p)
/*
* If any partition is open, all succeeding openings must be of the
- * same type.
+ * same type or read-only.
*/
if (sc->sc_dk.dk_openmask) {
if (((sc->sc_flags & VNF_SIMPLE) != 0) !=
- (vndsimple(dev) != 0)) {
+ (vndsimple(dev) != 0) && (flags & FWRITE)) {
error = EBUSY;
goto bad;
}