diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2006-08-27 09:29:27 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2006-08-27 09:29:27 +0000 |
commit | 7c64792c480cc84add17e4b02e4a031fc8e292fc (patch) | |
tree | a83efb21349e177fa75a566452ba93a266904e44 /sys/dev | |
parent | c4889df5928645f6195176fc76db1aeadca744b3 (diff) |
if a disk dissapears out of a raidset, then the raid info will list its id
as 0xff, and the command to query that phys disk will fail and cause the
ioctl to get stuck. so if the disk id is 0xff, fake an offline disk on
another bus since bioctl doesnt know how to show that properly.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/arc.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c index 3de84f53912..06919c1c70b 100644 --- a/sys/dev/pci/arc.c +++ b/sys/dev/pci/arc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc.c,v 1.43 2006/08/27 09:14:19 dlg Exp $ */ +/* $OpenBSD: arc.c,v 1.44 2006/08/27 09:29:26 dlg Exp $ */ /* * Copyright (c) 2006 David Gwynne <dlg@openbsd.org> @@ -1234,6 +1234,19 @@ arc_bio_disk(struct arc_softc *sc, struct bioc_disk *bd) goto out; } + if (raidinfo->device_array[bd->bd_diskid] == 0xff) { + /* + * the disk doesn't exist anymore. bio is too dumb to be + * able to display that, so put it on another bus + */ + bd->bd_channel = 1; + bd->bd_target = 0; + bd->bd_lun = 0; + bd->bd_status = BIOC_SDOFFLINE; + strlcpy(bd->bd_vendor, "disk missing", sizeof(bd->bd_vendor)); + goto out; + } + request[0] = ARC_FW_DISKINFO; request[1] = raidinfo->device_array[bd->bd_diskid]; error = arc_msgbuf(sc, request, sizeof(request), diskinfo, |