new locking API

David Zeuthen david at fubar.dk
Tue Mar 27 10:21:18 PDT 2007


On Tue, 2007-03-27 at 19:00 +0200, Kevin Ottens wrote:
> Ok, maybe that's just me being paranoid here. But depending how a device is 
> done, aren't we at risk if we lock it only partly, two interfaces could be 
> non orthogonal in their behavior.

If that's the case, then it's a bug that the latter interface don't
check on locks from other interfaces. This is all fine and intentional;
an interface may want to track locks on other interfaces and even other
device objects (e.g. the Volume locks track the Storage lock on the
originating storage device).

> Actually could be the case already with Volume.Crypto and Volume. If I lock 
> the Volume interface I have to check each time if it also implements the 
> Volume.Crypto interface to lock it too. Otherwise, one could perfectly call 
> Teardown on it despite the lock on the Volume interface. A good way to shoot 
> easily in your own foot IMO.

Funny you should mention this; I fixed that last night

http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=28fc2fa7c6bbde540d4f17e810ab59fda0c186ba

     David




More information about the hal mailing list