From 7c64792c480cc84add17e4b02e4a031fc8e292fc Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Sun, 27 Aug 2006 09:29:27 +0000 Subject: 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. --- sys/dev/pci/arc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'sys') 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 @@ -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, -- cgit v1.2.3