[Fwd: [OpenAFS-devel] Re: Kernel oops, using openafs-1.2.6-rc1]
chas williams
chas@cmf.nrl.navy.mil
Thu, 01 Aug 2002 10:11:29 -0400
In message <3D492A4C.BEEDD92A@lrz-muenchen.de>,Herbert Huber writes:
> <4>Starting AFS cache scan...afs global lock not held<1>Unable to handle k
>ernel paging request at virtual address ffffffff
oops my fault. i forgot, sometime alloc is actually called without
glock being held. this should fix the problems with starting up
under memcache.
Index: src/afs/LINUX/osi_alloc.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_alloc.c,v
retrieving revision 1.9.2.6
diff -u -d -b -w -r1.9.2.6 osi_alloc.c
--- src/afs/LINUX/osi_alloc.c 2002/07/31 22:31:15 1.9.2.6
+++ src/afs/LINUX/osi_alloc.c 2002/08/01 14:09:37
@@ -80,6 +80,7 @@
{
void *new = NULL;
int max_retry = 10;
+ int haveGlock = ISAFS_GLOCK();
/* if we can use kmalloc use it to allocate the required memory. */
while(!new && max_retry)
@@ -106,9 +107,9 @@
#else
current->state = TASK_INTERRUPTIBLE;
#endif
- if (drop_glock) AFS_GUNLOCK();
+ if (drop_glock && haveGlock) AFS_GUNLOCK();
schedule_timeout(HZ);
- if (drop_glock) AFS_GLOCK();
+ if (drop_glock && haveGlock) AFS_GLOCK();
#ifdef set_current_state
set_current_state(TASK_RUNNING);
#else