Re: loopback device HANGS (was: problems with loopback block device)

Keith Owens (kaos@ocs.com.au)
Fri, 15 May 1998 22:31:40 +1000


On Fri, 15 May 1998 00:22:54 +0200,
Stefan Ring <e9725446@student.tuwien.ac.at> wrote:
>I have tracked it down and found that the problem was introduced with
>version 2.1.95. Luckily, it is by far the smallest patch in a long row,
>so I could take a closer look at it.
>
>It is the two lines changed in drivers/block/ll_rw_blk.c
>After undoing the change, 2.1.95 worked fine for me. Unluckily, if I do
>the same in 2.1.101, it breaks even earlier -- when first accessing the
>hard disk.

The loop back problem is caused by request_fn going recursive (well it
is loop back) and deadlocking on the io_request_lock which it already
holds. When 2.1.95 came out I sent the same patch in and Linus said
no, the lock has to be held on entry to request_fn because most of the
low level routines expect to hold the lock. When code is going
recursive, the lock must be released then reacquired after recursion
has ended. Alas I don't know enough about VFS to code that.

Moving the lock before request_fn means that low level routines are
running without a critical lock. It may or may not work, depends
entirely on interrupt timing. Eventually it will fail.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu