[OpenAFS-devel] [PATCH] fix openafs crashes on linux 2.6.10-2.6.12, and all RHEL4 kernels

Derrick J Brashear shadow@dementia.org
Wed, 18 Apr 2007 15:14:43 -0400 (EDT)


On Wed, 18 Apr 2007, Chaskiel M Grundman wrote:

> --On Wednesday, April 18, 2007 02:45:36 PM -0400 Christopher Allen Wing 
> <wingc@engin.umich.edu> wrote:
>
>> I don't understand the usage of AFS_GLOCK(); why is it safe to drop and
>> re-acquire it in cases like this?  Is AFS_GLOCK intended to serialize all
>> AFS calls coming from vnode methods in the kernel?
>
> AFS_GLOCK is intended to prevent smp concurrency (and preemption). It also 
> provides mutual exclusion for ObtainXXXLock. AFS_GLOCK is dropped almost any 
> time the cache manager is going to sleep.

Of course that doesn't make it necessarily safe to drop and reacquire. In 
practice we've just attempted to make it safe every time it's cropped up 
that it's not.

The __vmalloc approach would be safer if we were even vaguely sure that it 
was exported in enough cases.