On 8/25/05, Jason Crawford <[EMAIL PROTECTED]> wrote: > On 8/25/05, Jason Crawford <[EMAIL PROTECTED]> wrote: > > I updated my cvs tree today, and recompiled GENERIC with today's > > source, and now the system crashes on boot, telling me that it cannot > > read the disk label, but a GENERIC from two days ago can read the disk > > label just fine. Here is the working dmesg from GENERIC of two days > > ago, and dmesg from GENERIC from today with the trace and ps output. > > Any other information that's needed, please ask, I'm not sure what > > else to include, but this stuff is always asked for. > > > <snip dmesgs> > A little more info, as I downloaded the August 24 snapshot, to see if > my source tree had somehow gotten corrupted. I got an error message > while in the bsd.rd kernel, that both fdisk and disklabel reported: > DIOCGDINFO: Input/output error > I'm not sure what that means exactly, but I'm sure that info would > help in figuring out the problem. > Even more information, I found the exact code that causes the crash. It is whatever code that was commited between revision 1.86 and 1.87 of sd.c inside /usr/src/sys/scsi that is the culprit. I compiled the most recient kernel except sd.c being revision 1.86, and it works. I changed sd.c to revision 1.87 and the system crashes with the error message reported in my first mail. I really hope that there is a developer out there who will figure out why this is causing the crash, because I can't see an obvious reason from the code. Here is the exact diff for r1.86 to r1.87:
Index: sd.c =================================================================== RCS file: /cvs/src/sys/scsi/sd.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- sd.c 21 Aug 2005 16:25:52 -0000 1.86 +++ sd.c 23 Aug 2005 23:31:04 -0000 1.87 @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.86 2005/08/21 16:25:52 krw Exp $ */ +/* $OpenBSD: sd.c,v 1.87 2005/08/23 23:31:04 krw Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -216,10 +216,9 @@ scsi_autoconf | SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT); - /* Try to start the unit if it wasn't ready. */ - if (error == EIO) - error = scsi_start(sc_link, SSS_START, - SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE); + /* Spin up the unit ready or not. */ + error = scsi_start(sc_link, SSS_START, scsi_autoconf | SCSI_SILENT | + SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE); if (error) result = SDGP_RESULT_OFFLINE; @@ -386,11 +385,10 @@ (part == RAW_PART && fmt == S_IFCHR) ? SCSI_SILENT : 0 | SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE); - /* Try to start the unit if it wasn't ready. */ - if (error == EIO) - error = scsi_start(sc_link, SSS_START, - SCSI_IGNORE_ILLEGAL_REQUEST | - SCSI_IGNORE_MEDIA_CHANGE); + /* Spin up the unit, ready or not. */ + error = scsi_start(sc_link, SSS_START, + (part == RAW_PART && fmt == S_IFCHR) ? SCSI_SILENT : 0 | + SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE); if (error) { if (part == RAW_PART && fmt == S_IFCHR) {