patch on ide.c - was: Re: lilo/kernel problem

Andries.Brouwer@cwi.nl
Sat, 20 Jul 1996 01:07:07 +0200


Mark Lord:

: Johnie Stafford wrote:
::
:: Here is a small patch to ide.c to correct an error message it prints:
: ...
:: The reason I noticed this discrepancy is because I see it several
:: times every time I run lilo (v19). For each entry in my lilo.conf file
:: I get this on my console:
::
:: Jul 14 10:29:18 kb5yvf kernel: ide: probable bad entry for /dev/hdc
:: Jul 14 10:29:18 kb5yvf kernel: ide: to fix it, run: /usr/src/linux/drivers/block/MAKEDEV.ide

: Mmm.. Looks like a bug in lilo19. It is trying to open invalid devices.

Possibly a bug in lilo, but certainly also a kernel bug.

On the one hand it is bad practice to guess at path names -
they may be right on some systems but will certainly be wrong
on others.

On the other hand it is bad practice to try and outguess the
user's intentions. LILO is doing entirely legitimate things,
and the kernel should not pollute the console and log with
error messages.

[In fact what LILO does is finding out what device number a SCSI disk
might have under DOS/BIOS. It does this by opening raw IDE devices
03:00, 03:40, 03:80 .. until some open fails. This determines the
DOS/BIOS number 0x80, 0x81, ... that the SCSI disk has.
It may be a bug in LILO that geometry.c:geo_query_dev() does not
reckon with the possibility that all of major 3, major 22 and major 8
are present. I do not add a fix since I do not know how DOS/BIOS
numbers the disks in such a case. My BIOS only knows about 0x80 and 0x81.]

Thus, both because nothing is wrong with trying to open a nonexisting
device, and because the kernel should not invent pathnames, thus
setting user policy, I think the fragment below between #if 0 ... #endif
should be deleted.

Andries

--- ide.c~ Thu Jul 4 00:06:29 1996
+++ ide.c Sat Jul 20 00:35:45 1996
@@ -1683,9 +1683,11 @@
ide_drive_t *drive = &hwif->drives[unit];
if (drive->present)
return drive;
+#if 0
} else if (major == IDE0_MAJOR && unit < 4) {
printk("ide: probable bad entry for /dev/hd%c\n", 'a'+unit);
printk("ide: to fix it, run: /usr/src/linux/drivers/block/MAKEDEV.ide\n");
+#endif
}
break;
}