[OpenAFS] who has that file open

tfitz tfitz@MIT.EDU
Sat, 3 Dec 2005 18:28:41 -0500


> David Bear wrote:
>> since file locking is 'just around the corner' for openafs (at least
>> I'm hopeful) the question I have now is will (is) there be a way to
>> ask the server who has a particular file open.

The information is somewhat available (eventually) by turning
up debugging on the fileserver and waiting 1 minute for all
the lock refreshes to come in.

A partial solution might be an rpc to get the count of read
locks and the IP address of the last client to acquire a lock.
This is all that's needed if a write lock or only 1 read
lock is held, which will be the most common situation.  This
avoids holding a list of addresses for all the read locks.

I'm a little surprised reading through the server-side lock
implementation.  It looks like a malicious client can free
locks it doesn't own.  At minimum, a client with a read lock
could release it repeatedly to wipe out all other read locks
on the file, and it looks like anyone could release a write
lock no matter who holds it (though I'm not positive of
this). Does the server lock implementation really depend on
client-side benevolence?