Re: [patch] Re: More info on floppy problems in 2.3.99pre6

From: Andries Brouwer (aeb@veritas.com)
Date: Wed May 24 2000 - 17:15:34 EST


On Wed, May 24, 2000 at 10:20:48PM +0000, Petr Vandrovec wrote:

> If I decoded it correctly, problem was that 'bdev->bd_op' was non-null,
> but pointed to unmapped area...

Yes, I also encountered that problem (and think I mentioned it
on linux-kernel yesterday or the day before).

Indeed, when the module is unloaded bd_op is not zeroed.
If you try to use the device again your system will crash
because blkdev_get() or blkdev_open() follow pointers to
the no longer present module.
If you recompile and insmod then the module is present again
but still most likely bd_op points at garbage.
A temporary fix is to do (twice, in fs/block_dev.c)
        bdev->bd_op = get_blkfops(MAJOR(inode->i_rdev));
unconditionally, regardless of the old value of bdev->bd_op.
The correct fix is of course to remove all pointers to a
module when the module is unloaded.

Andries

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:12 EST