summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-02-08 23:28:07 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-02-08 23:28:07 +0000
commit46520f860a2e88744dfdce82395eb4b219928162 (patch)
treea44cbe4eb2ac8c2b0f9f73f68bd5fbccdae8533e /sys
parentf71ebb176749e05725b938e35d539501f8a44ab6 (diff)
Use character raw device to read disklabel during bootprobe, as all
other devices do. Silences complaints about missing media on removable media devices. ok marco@ jsing@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/softraid.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 57d6649b27a..f51f8ad03d9 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.189 2010/01/09 23:15:06 krw Exp $ */
+/* $OpenBSD: softraid.c,v 1.190 2010/02/08 23:28:06 krw Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -857,7 +857,13 @@ sr_meta_native_bootprobe(struct sr_softc *sc, struct device *dv,
if (majdev == -1)
goto done;
dev = MAKEDISKDEV(majdev, dv->dv_unit, RAW_PART);
- if (bdevvp(dev, &vn)) {
+
+ /*
+ * Use character raw device to avoid SCSI complaints about missing
+ * media on removable media devices.
+ */
+ dev = MAKEDISKDEV(major(blktochr(dev)), dv->dv_unit, RAW_PART);
+ if (cdevvp(dev, &vn)) {
printf("%s:, sr_meta_native_bootprobe: can't allocate vnode\n",
DEVNAME(sc));
goto done;