On Wed, Aug 11, 2010 at 11:34:53PM +0100, Simon Wilkinson wrote: > I'm still interesting in the error code you're seeing, but on further > analysis, I think I've identified two problems. They're both related to race > conditions in the way that we enrol AFS locks with the kernel's local lock > management system (we do this so that the kernel can handle byte-range locks > on the local machine for us). > > The first is that locks and unlocks can race against each other. On a lock we > do SetAFSLock, SetKernelLock. On unlock we do ReleaseAFSLock, > ReleaseKernelLock. However, we don't hold any locks on the file whilst we do > so. Multiple calls to set a lock are safe, as the SetAFSLock serialises them. > However, a lock and an unlock may race each other. In this case we have > > Process A Process B > SetAFSLock > SetKernelLock > .... > ReleaseAFSLock > SetAFSLock > SetKernelLock > ReleaseKernelLock > > Process B can't get the kernel lock, despite the fact that it has the AFS > lock, because process A hasn't released it yet. So you get an error message.
Isn't possible to do ReleaseKernelLock first, and then ReleaseAFSLock on unlock? 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
