[lkml]   [1997]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Loop Encryption
> > > Using BH_Protected seems to work for the loop driver - buffers for the
> > > requests it creates cannot be freed until the loop driver is finished
> > > with them [or so I'm led to believe by the ramdisk driver].
> >
> > If that's all you want, then use b_count instead. It has the
> > advantage that two concurrent processes trying to pin the buffer in
> > memory won't conflict with each other.
> Thanks for the suggestion, but using b_count doesn't work in this case.
> There must be something else that BH_Protected does <shrug>

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

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
Linux Plug-and-Play Hardware Support
XFree86 Matrox Team
Ottawa-Carleton Linux User's Group (OCLUG)

 \ /
  Last update: 2005-03-22 13:39    [W:0.096 / U:5.232 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site