From: Chas Williams Date: Thu, 1 Aug 2002 17:13:21 +0000 (+0000) Subject: STABLE12-linux-alloc-dont-drop-what-you-dont-have-20020801 X-Git-Tag: openafs-stable-1_2_6~6 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=832490126e5bd1927e9ef377342a1321830fdcc8;p=packages%2Fo%2Fopenafs.git STABLE12-linux-alloc-dont-drop-what-you-dont-have-20020801 avoid trying to drop a glock we don't have (cherry picked from commit 9e06544249bf6a536c3f3f26048f6809b36b0772) --- diff --git a/src/afs/LINUX/osi_alloc.c b/src/afs/LINUX/osi_alloc.c index 9077db83e..a89a74d18 100644 --- a/src/afs/LINUX/osi_alloc.c +++ b/src/afs/LINUX/osi_alloc.c @@ -80,6 +80,7 @@ static void *linux_alloc(unsigned int asize, int drop_glock) { 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 @@ static void *linux_alloc(unsigned int asize, int drop_glock) #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