Re: oops in floppy_eject

Alain Knaff (alknaff@hal.local.host)
Thu, 20 Feb 1997 21:37:22 +0100


>
>It seems floppy_eject oopses when there are no floppy controllers
>in the machine. In particular, this happens when nfsroot mount fails.
>
>Probably, the function calling eject_floppy should be fixed to check
>if there is a floppy before trying to mount root from it.

Could you try whether the following patch works:

diff -ur v2.1.26/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
--- v2.1.26/linux/drivers/block/floppy.c Thu Feb 20 21:33:05 1997
+++ linux/drivers/block/floppy.c Thu Feb 20 21:35:54 1997
@@ -3924,10 +3924,12 @@
DPRINT("Read linux/drivers/block/README.fd\n");
}

+static int have_no_fdc= -EIO;
+
int floppy_init(void)
{
int i,unit,drive;
- int have_no_fdc= -EIO;
+

raw_cmd = 0;

@@ -4237,6 +4239,8 @@
void floppy_eject(void)
{
int dummy;
+ if(have_no_fdc)
+ return;
floppy_grab_irq_and_dma();
lock_fdc(MAXTIMEOUT,0);
dummy=fd_eject(0);