aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog11
-rw-r--r--nscd/aicache.c2
-rw-r--r--nscd/grpcache.c6
-rw-r--r--nscd/hstcache.c4
-rw-r--r--nscd/initgrcache.c4
-rw-r--r--nscd/mem.c6
-rw-r--r--nscd/pwdcache.c6
-rw-r--r--nscd/servicescache.c4
8 files changed, 16 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index a81c5b4..37f20a4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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
@@ -5,6 +15,7 @@
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
diff --git a/nscd/aicache.c b/nscd/aicache.c
index 524c0a6..8dac48e 100644
--- a/nscd/aicache.c
+++ b/nscd/aicache.c
@@ -543,8 +543,6 @@ next_nip:
(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;
diff --git a/nscd/grpcache.c b/nscd/grpcache.c
index 184d538..fc20084 100644
--- a/nscd/grpcache.c
+++ b/nscd/grpcache.c
@@ -146,8 +146,6 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
(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;
@@ -367,12 +365,10 @@ cache_addgr (struct database_dyn *db, int fd, request_header *req,
(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];
diff --git a/nscd/hstcache.c b/nscd/hstcache.c
index 51e2273..77ffcdf 100644
--- a/nscd/hstcache.c
+++ b/nscd/hstcache.c
@@ -153,8 +153,6 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
(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;
@@ -404,8 +402,6 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req,
(void) cache_add (req->type, key_copy, req->key_len,
&dataset->head, true, db, owner, he == NULL);
-
- pthread_rwlock_unlock (&db->lock);
}
}
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c
index c33aaf3..f8d4742 100644
--- a/nscd/initgrcache.c
+++ b/nscd/initgrcache.c
@@ -230,8 +230,6 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
(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;
@@ -388,8 +386,6 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
(void) cache_add (INITGROUPS, cp, req->key_len, &dataset->head, true,
db, uid, he == NULL);
-
- pthread_rwlock_unlock (&db->lock);
}
}
diff --git a/nscd/mem.c b/nscd/mem.c
index fcea6db..80ea951 100644
--- a/nscd/mem.c
+++ b/nscd/mem.c
@@ -566,9 +566,6 @@ mempool_alloc (struct database_dyn *db, size_t len, int data_alloc)
}
}
- if (data_alloc)
- pthread_rwlock_unlock (&db->lock);
-
if (! db->last_alloc_failed)
{
dbg_log (_("no more memory for database '%s'"), dbnames[db - dbs]);
@@ -591,5 +588,8 @@ mempool_alloc (struct database_dyn *db, size_t len, int data_alloc)
pthread_mutex_unlock (&db->memlock);
+ if (data_alloc)
+ pthread_rwlock_unlock (&db->lock);
+
return res;
}
diff --git a/nscd/pwdcache.c b/nscd/pwdcache.c
index 2338e7e..fc5b44e 100644
--- a/nscd/pwdcache.c
+++ b/nscd/pwdcache.c
@@ -153,8 +153,6 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
(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;
@@ -362,12 +360,10 @@ cache_addpw (struct database_dyn *db, int fd, request_header *req,
(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];
diff --git a/nscd/servicescache.c b/nscd/servicescache.c
index dc98d30..c965c97 100644
--- a/nscd/servicescache.c
+++ b/nscd/servicescache.c
@@ -136,8 +136,6 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
(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;
@@ -317,8 +315,6 @@ cache_addserv (struct database_dyn *db, int fd, request_header *req,
(void) cache_add (req->type, key_copy, req->key_len,
&dataset->head, true, db, owner, he == NULL);
-
- pthread_rwlock_unlock (&db->lock);
}
}