diff options
| author | 2010-02-08 23:28:06 +0000 | |
|---|---|---|
| committer | 2010-02-08 23:28:06 +0000 | |
| commit | 0b28d9165835732d4b67a310f6203073dd6fce3b (patch) | |
| tree | 3f80f2b48ae54b84611ca9e78221c253a9b73048 /sys/dev/softraid.c | |
| parent | sync (diff) | |
| download | wireguard-openbsd-0b28d9165835732d4b67a310f6203073dd6fce3b.tar.xz wireguard-openbsd-0b28d9165835732d4b67a310f6203073dd6fce3b.zip | |
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/dev/softraid.c')
| -rw-r--r-- | sys/dev/softraid.c | 10 |
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; |
