On Thu, Aug 12, 2010 at 02:45:59PM +0100, Simon Wilkinson wrote:
> 
> On 12 Aug 2010, at 14:43, Hans-Werner Paulsen wrote:
> > Isn't possible to do ReleaseKernelLock first, and then ReleaseAFSLock on
> > unlock?
> 
> If ReleaseAFSLock fails for some reason, we don't want to release the kernel 
> lock. Releasing it, only to reobtain it, is racy. I'm pretty sure that the 
> correct solution here is to hold the vcache lock across the calls - I'll 
> hopefully get a chance to look at some code to do this today.

Releasing a lock:
Holding the vcache lock does not guarantee that we can reobtain the AFS lock,
if the kernel release lock fails.
Obtaining a lock:
Holding the vcache lock does not guarantee that we can release the AFS lock,
if the kernel set lock fails. (The current code is doing this.)
On the other hand local byte range locking is a hack, we need AFS byte range
locking. Therefore we should not put too much work into the local kernel
locking code.
Releasing the kernel lock before releasing the AFS lock is a simple
modification, and is better than the current code.
I will send a patch to gerrit, soon.

HW

-- 
Hans-Werner Paulsen             [email protected]
MPI für Astrophysik             Tel 089-30000-2602
Karl-Schwarzschild-Str. 1       Fax 089-30000-2235      
D-85741 Garching
_______________________________________________
OpenAFS-devel mailing list
[email protected]
https://lists.openafs.org/mailman/listinfo/openafs-devel

Reply via email to