+2009-07-16 Petr Baudis <pasky@suse.cz>
+
+ * nscd/mem.c (mempool_alloc): Fix unlock missing in the else branch.
+ * nscd/aicache.c: Remove bogus db->lock unlock.
+ * nscd/grpcache.c: Likewise.
+ * nscd/hstcache.c: Likewise.
+ * nscd/initgrcache.c: Likewise.
+ * nscd/pwdcache.c: Likewise.
+ * nscd/servicescache.c: Likewise.
+
2009-07-16 Ulrich Drepper <drepper@redhat.com>
* nscd/cache.c (cache_add): Use atomic_compare_and_exchange_bool_rel
is written before the list head update.
Patch by Andreas Schwab <aschwab@redhat.com>.
+2009-07-16 Ulrich Drepper <drepper@redhat.com>
Jakub Jelinek <jakub@redhat.com>
* malloc/malloc.c [ATOMIC_FASTBINS] (_int_free): Make check for
(void) cache_add (req->type, key_copy, req->key_len, &dataset->head,
true, db, uid, he == NULL);
- pthread_rwlock_unlock (&db->lock);
-
/* Mark the old entry as obsolete. */
if (dh != NULL)
dh->usable = false;
(void) cache_add (req->type, &dataset->strdata, req->key_len,
&dataset->head, true, db, owner, he == NULL);
- pthread_rwlock_unlock (&db->lock);
-
/* Mark the old entry as obsolete. */
if (dh != NULL)
dh->usable = false;
(void) cache_add (GETGRBYGID, cp, key_offset, &dataset->head,
false, db, owner, false);
}
-
- out:
- pthread_rwlock_unlock (&db->lock);
}
}
+out:
if (__builtin_expect (written != total, 0) && debug_level > 0)
{
char buf[256];
(void) cache_add (req->type, &dataset->strdata, req->key_len,
&dataset->head, true, db, owner, he == NULL);
- pthread_rwlock_unlock (&db->lock);
-
/* Mark the old entry as obsolete. */
if (dh != NULL)
dh->usable = false;
(void) cache_add (req->type, key_copy, req->key_len,
&dataset->head, true, db, owner, he == NULL);
-
- pthread_rwlock_unlock (&db->lock);
}
}
(void) cache_add (req->type, key_copy, req->key_len,
&dataset->head, true, db, uid, he == NULL);
- pthread_rwlock_unlock (&db->lock);
-
/* Mark the old entry as obsolete. */
if (dh != NULL)
dh->usable = false;
(void) cache_add (INITGROUPS, cp, req->key_len, &dataset->head, true,
db, uid, he == NULL);
-
- pthread_rwlock_unlock (&db->lock);
}
}
}
}
- if (data_alloc)
- pthread_rwlock_unlock (&db->lock);
-
if (! db->last_alloc_failed)
{
dbg_log (_("no more memory for database '%s'"), dbnames[db - dbs]);
pthread_mutex_unlock (&db->memlock);
+ if (data_alloc)
+ pthread_rwlock_unlock (&db->lock);
+
return res;
}
(void) cache_add (req->type, key_copy, req->key_len,
&dataset->head, true, db, owner, he == NULL);
- pthread_rwlock_unlock (&db->lock);
-
/* Mark the old entry as obsolete. */
if (dh != NULL)
dh->usable = false;
(void) cache_add (GETPWBYUID, cp, key_offset, &dataset->head,
false, db, owner, false);
}
-
- out:
- pthread_rwlock_unlock (&db->lock);
}
}
+out:
if (__builtin_expect (written != total, 0) && debug_level > 0)
{
char buf[256];
(void) cache_add (req->type, &dataset->strdata, req->key_len,
&dataset->head, true, db, owner, he == NULL);
- pthread_rwlock_unlock (&db->lock);
-
/* Mark the old entry as obsolete. */
if (dh != NULL)
dh->usable = false;
(void) cache_add (req->type, key_copy, req->key_len,
&dataset->head, true, db, owner, he == NULL);
-
- pthread_rwlock_unlock (&db->lock);
}
}