Apologies to Stephen Tweedie - he is entirely right about what b_count
does and what BH_Protected does. It seems keeping buffers from being freed
is not my problem with the loop driver.
It appears there are two possible deadlocks caused by the loop driver.
1) Running out of requests
2) Running out of buffers.
The only way to solve these is to let a loop request complete, which
can mean it needs to allocate more requests and buffers :-/
There are kludges for these in fs/buffer.c and drivers/block/ll_rw_blk.c
but they only really handle the case when a loop device is associated to
a non-loop device.
Patient: "Doctor! Doctor! It hurts when I do this..."
Doctor : "Then don't do that."
It seems to me that the _logical_ solution is to re-write the loop request
handler. It should be smart enough to handle requests to loop devices
associated to loop devices, completely on it's own without making buffer
requests.
As always, suggestion and commets are welcomed.
P.S. Is it me, or is get_request() in drivers/block/ll_rw_blk.c
particularly complex for the simple job it does (with interrupts
disabled I might add)?
-- Andrew E. Mileski mailto:aem@netcom.ca Linux Plug-and-Play Hardware Support http://www.redhat.com/linux-info/pnp/ XFree86 Matrox Team http://www.bf.rmit.edu.au/~ajv/xf86-matrox.html Ottawa-Carleton Linux User's Group (OCLUG) http://www.storm.ca/~linux/