Re: sysv filesystem lockups

Linus Torvalds (torvalds@cs.helsinki.fi)
Sun, 14 Apr 1996 14:40:25 +0300 (EET DST)


On 14 Apr 1996, Raul Miller wrote:
>
> Linus Torvalds:
> > This is probably not a filesystem question: it looks like the
> > loopback (and possibly md) drivers are broken with newer kernels
> > due to getting confused about the plugs.
>
> plugs?

The low-level driver code uses "plugs" to make sure that requests are
queued sanely to disk: a "plug" request is inserted into the request
queue to tell the disk drivers not to start the IO immediately, because
more requests are coming soon.

The md and loopback device drivers probably cause a system deadlock by
trying to insert a request on another drivers request queue from within
their own unplug routines, before the other devices have been unplugged.
If they then sleep, the other devices will never be unplugged, so..

One possible fix would be to never plug the md or loopback drivers, and
that would be easy enough to test. You'll find the "plug_device()" call
in drivers/block/ll_rw_block.c, it looks something like this:

if (!req) {
plug_device(blk_dev + major);
} else ...

and you could try to disable the plugging for LOOP_MAJOR and for
MD_MAJOR. Something like

if (!req) {
if (major != LOOP_MAJOR && major != MD_MAJOR)
plug_device(blk_dev + major);
} else ...

might be sufficient. Does that work for you?

Linus