avoid trying to drop a glock we don't have
{
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)
#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