import 389-ds-base-1.3.4.0-21.el7_2

This commit is contained in:
CentOS Sources 2015-12-08 05:28:26 -05:00
parent a2f18fa85c
commit 246821ed37
9 changed files with 577 additions and 1 deletions

View file

@ -0,0 +1,68 @@
From 68cdd9df5c923cca591dfe7d22207d7d31ef4928 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Fri, 23 Oct 2015 15:17:44 -0400
Subject: [PATCH 69/75] Ticket 48311 - nunc-stans: Attempt to release
connection that is not acquired
Bug Description: ns_connection_post_io_or_closing() was not aquiring the
connection in the optimized build, which led to the connection
ref count getting out sequence.
Fix Description Do not call connection_acquire_nolock() inside a PR_ASSERT call.
Also changed other PR_ASSERTs to only be called if DEBUG is set
https://fedorahosted.org/389/ticket/48311
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 97946bd212c5094a490d6a3429e0d5763ccd39ce)
(cherry picked from commit a8d30b356f312b24132f4ced324a67601b7cfb9b)
---
ldap/servers/slapd/daemon.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index ba73da3..82099bc 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -1836,7 +1836,11 @@ ns_handle_closure(struct ns_job_t *job)
int do_yield = 0;
/* this function must be called from the event loop thread */
+#ifdef DEBUG
PR_ASSERT(0 == NS_JOB_IS_THREAD(ns_job_get_type(job)));
+#else
+ NS_JOB_IS_THREAD(ns_job_get_type(job));
+#endif
PR_Lock(c->c_mutex);
connection_release_nolock_ext(c, 1); /* release ref acquired for event framework */
PR_ASSERT(c->c_ns_close_jobs == 1); /* should be exactly 1 active close job - this one */
@@ -1889,7 +1893,11 @@ ns_connection_post_io_or_closing(Connection *conn)
/* process event normally - wait for I/O until idletimeout */
tv.tv_sec = conn->c_idletimeout;
tv.tv_usec = 0;
- PR_ASSERT(0 == connection_acquire_nolock(conn)); /* event framework now has a reference */
+#ifdef DEBUG
+ PR_ASSERT(0 == connection_acquire_nolock(conn));
+#else
+ connection_acquire_nolock(conn); /* event framework now has a reference */
+#endif
ns_add_io_timeout_job(conn->c_tp, conn->c_prfd, &tv,
NS_JOB_READ|NS_JOB_PRESERVE_FD,
ns_handle_pr_read_ready, conn, NULL);
@@ -1911,7 +1919,11 @@ ns_handle_pr_read_ready(struct ns_job_t *job)
Connection *c = (Connection *)ns_job_get_data(job);
/* this function must be called from the event loop thread */
+#ifdef DEBUG
PR_ASSERT(0 == NS_JOB_IS_THREAD(ns_job_get_type(job)));
+#else
+ NS_JOB_IS_THREAD(ns_job_get_type(job));
+#endif
PR_Lock(c->c_mutex);
LDAPDebug2Args(LDAP_DEBUG_CONNS, "activity on conn %" NSPRIu64 " for fd=%d\n",
--
2.4.3

View file

@ -0,0 +1,79 @@
From d7609aa1166fb79dd5e1f838f5ab27e0924441a1 Mon Sep 17 00:00:00 2001
From: William Brown <firstyear@redhat.com>
Date: Fri, 6 Nov 2015 14:56:44 +1000
Subject: [PATCH 70/75] Ticket 48311 -nunc-stans: Attempt to release
connection that is not acquired https://fedorahosted.org/389/ticket/48311
Bug Description: DS with nunc stans enabled produces lots of messages like
[13/Oct/2015:11:29:24 -0400] connection - conn=98 fd=161 Attempt to release
connection that is not acquired
FixDescription: From the original patch:
* Do not call connection_acquire_nolock() inside a PR_ASSERT call.
* Also changed other PR_ASSERTs to only be called if DEBUG is set
This additionally guarantees the return codes of these functions since we have
removed the PR_ASSERT that previously wrapped these function calls. If these
assertions fail, we log to the error log in all cases.
Author: wibrown
Review by: mreynolds, nhosoi (Thanks!)
(cherry picked from commit 49aaf98732d1e16dde3edb81272de8203aded21c)
(cherry picked from commit b03987689c3a2477630e2a3452e64cc7759ba5f3)
---
ldap/servers/slapd/daemon.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index 82099bc..bd3bfb2 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -1839,7 +1839,12 @@ ns_handle_closure(struct ns_job_t *job)
#ifdef DEBUG
PR_ASSERT(0 == NS_JOB_IS_THREAD(ns_job_get_type(job)));
#else
- NS_JOB_IS_THREAD(ns_job_get_type(job));
+ /* This doesn't actually confirm it's in the event loop thread, but it's a start */
+ if (NS_JOB_IS_THREAD(ns_job_get_type(job)) != 0) {
+ LDAPDebug2Args(LDAP_DEBUG_ANY, "ns_handle_closure: Attempt to close outside of event loop thread %" NSPRIu64 " for fd=%d\n",
+ c->c_connid, c->c_sd);
+ return;
+ }
#endif
PR_Lock(c->c_mutex);
connection_release_nolock_ext(c, 1); /* release ref acquired for event framework */
@@ -1896,7 +1901,14 @@ ns_connection_post_io_or_closing(Connection *conn)
#ifdef DEBUG
PR_ASSERT(0 == connection_acquire_nolock(conn));
#else
- connection_acquire_nolock(conn); /* event framework now has a reference */
+ if (connection_acquire_nolock(conn) != 0) { /* event framework now has a reference */
+ /*
+ * This has already been logged as an error in ./ldap/servers/slapd/connection.c
+ * The error occurs when we get a connection in a closing state.
+ * For now we return, but there is probably a better way to handle the error case.
+ */
+ return;
+ }
#endif
ns_add_io_timeout_job(conn->c_tp, conn->c_prfd, &tv,
NS_JOB_READ|NS_JOB_PRESERVE_FD,
@@ -1922,7 +1934,12 @@ ns_handle_pr_read_ready(struct ns_job_t *job)
#ifdef DEBUG
PR_ASSERT(0 == NS_JOB_IS_THREAD(ns_job_get_type(job)));
#else
- NS_JOB_IS_THREAD(ns_job_get_type(job));
+ /* This doesn't actually confirm it's in the event loop thread, but it's a start */
+ if (NS_JOB_IS_THREAD(ns_job_get_type(job)) != 0) {
+ LDAPDebug2Args(LDAP_DEBUG_ANY, "ns_handle_pr_read_ready: Attempt to handle read ready outside of event loop thread %" NSPRIu64 " for fd=%d\n",
+ c->c_connid, c->c_sd);
+ return;
+ }
#endif
PR_Lock(c->c_mutex);
--
2.4.3

View file

@ -0,0 +1,47 @@
From 34239335f2658905a2f96865bea0503bb6ad5ec1 Mon Sep 17 00:00:00 2001
From: Thierry Bordaz <tbordaz@redhat.com>
Date: Tue, 3 Nov 2015 15:59:54 +0100
Subject: [PATCH 71/75] Ticket 47976: deadlock in mep delete post op
Bug Description:
When deleting the original entry, some DB pages are acquired in write.
The deadlock occurs because when reading the parent entry of the MEP entry
MEP plugin requires read access to one of the page acquired by the deletion of the original entry.
The read access can be granted if it is using the parent txn.
This bug requires that the parent entry of the MEP entry is not found in the entry cache, so
it requires database access
Fix Description:
Fix ldbm_delete, so that it reads id2entry db with parent txn
https://fedorahosted.org/389/ticket/47976
Reviewed by: Ludwig Krispenz, Rich Megginson (Thanks you !!)
Platforms tested: F17
Flag Day: no
Doc impact: no
(cherry picked from commit 55434d308b4e459ba3a169eff94568312dba767c)
---
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index f31d545..100a71d 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -477,7 +477,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
* the parent. If we fail to lock the entry, just try again.
*/
while(1){
- parent = id2entry(be, pid ,NULL, &retval);
+ parent = id2entry(be, pid ,&txn, &retval);
if (parent && (cache_retry = cache_lock_entry(&inst->inst_cache, parent))) {
/* Failed to obtain parent entry's entry lock */
if(cache_retry == RETRY_CACHE_LOCK &&
--
2.4.3

View file

@ -0,0 +1,170 @@
From 24129b41820b87d613e721f8530e1955f1cce0ff Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Thu, 5 Nov 2015 10:44:08 -0800
Subject: [PATCH 72/75] Ticket #48338 - SimplePagedResults -- abandon could
happen between the abandon check and sending results
Description: An abandon request for a SimplePagedResults request could
happened between the abandon check and the code for sending the search
results. The abandon frees the search results although sending result
code still refers it.
Fix description: The code (from getting search results through sending
the search results) in op_shared_search is protected by c_mutex locking.
https://fedorahosted.org/389/ticket/48338
Reviewed by rmeggins@redhat.com (Thank you, Rich!!)
(cherry picked from commit 390b8bd9076e8976facc0858e60985d6b4fac05c)
(cherry picked from commit 8f49d33d30fade7b579062414250a0ddb1a66c62)
---
ldap/servers/slapd/opshared.c | 13 ++++++++-----
ldap/servers/slapd/pagedresults.c | 28 ++++++++++++++++++----------
ldap/servers/slapd/proto-slap.h | 5 ++---
3 files changed, 28 insertions(+), 18 deletions(-)
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index dcdbb04..586ca1f 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -500,7 +500,7 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
be = be_list[index];
}
}
- pr_search_result = pagedresults_get_search_result(pb->pb_conn, operation, pr_idx);
+ pr_search_result = pagedresults_get_search_result(pb->pb_conn, operation, 0/*not locked*/, pr_idx);
estimate = pagedresults_get_search_result_set_size_estimate(pb->pb_conn, operation, pr_idx);
if (pagedresults_get_unindexed(pb->pb_conn, operation, pr_idx)) {
opnote |= SLAPI_OP_NOTE_UNINDEXED;
@@ -675,13 +675,15 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
* In async paged result case, the search result might be released
* by other theads. We need to double check it in the locked region.
*/
- pr_search_result = pagedresults_get_search_result(pb->pb_conn, operation, pr_idx);
+ PR_Lock(pb->pb_conn->c_mutex);
+ pr_search_result = pagedresults_get_search_result(pb->pb_conn, operation, 1/*locked*/, pr_idx);
if (pr_search_result) {
- if (pagedresults_is_abandoned_or_notavailable(pb->pb_conn, pr_idx)) {
+ if (pagedresults_is_abandoned_or_notavailable(pb->pb_conn, 1/*locked*/, pr_idx)) {
pagedresults_unlock(pb->pb_conn, pr_idx);
/* Previous operation was abandoned and the simplepaged object is not in use. */
send_ldap_result(pb, 0, NULL, "Simple Paged Results Search abandoned", 0, NULL);
rc = LDAP_SUCCESS;
+ PR_Unlock(pb->pb_conn->c_mutex);
goto free_and_return;
} else {
slapi_pblock_set( pb, SLAPI_SEARCH_RESULT_SET, pr_search_result );
@@ -689,7 +691,8 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
/* search result could be reset in the backend/dse */
slapi_pblock_get(pb, SLAPI_SEARCH_RESULT_SET, &sr);
- pagedresults_set_search_result(pb->pb_conn, operation, sr, 0, pr_idx);
+ pagedresults_set_search_result(pb->pb_conn, operation, sr, 1/*locked*/, pr_idx);
+ PR_Unlock(pb->pb_conn->c_mutex);
}
} else {
pr_stat = PAGEDRESULTS_SEARCH_END;
@@ -720,7 +723,7 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
if (PAGEDRESULTS_SEARCH_END == pr_stat) {
pagedresults_lock(pb->pb_conn, pr_idx);
slapi_pblock_set(pb, SLAPI_SEARCH_RESULT_SET, NULL);
- if (!pagedresults_is_abandoned_or_notavailable(pb->pb_conn, pr_idx)) {
+ if (!pagedresults_is_abandoned_or_notavailable(pb->pb_conn, 0/*not locked*/, pr_idx)) {
pagedresults_free_one(pb->pb_conn, operation, pr_idx);
}
pagedresults_unlock(pb->pb_conn, pr_idx);
diff --git a/ldap/servers/slapd/pagedresults.c b/ldap/servers/slapd/pagedresults.c
index 87447c4..4458cfb 100644
--- a/ldap/servers/slapd/pagedresults.c
+++ b/ldap/servers/slapd/pagedresults.c
@@ -395,20 +395,25 @@ pagedresults_set_current_be(Connection *conn, Slapi_Backend *be, int index, int
}
void *
-pagedresults_get_search_result(Connection *conn, Operation *op, int index)
+pagedresults_get_search_result(Connection *conn, Operation *op, int locked, int index)
{
void *sr = NULL;
if (!op_is_pagedresults(op)) {
return sr; /* noop */
}
- LDAPDebug1Arg(LDAP_DEBUG_TRACE,
- "--> pagedresults_get_search_result: idx=%d\n", index);
+ LDAPDebug2Args(LDAP_DEBUG_TRACE,
+ "--> pagedresults_get_search_result(%s): idx=%d\n",
+ locked?"locked":"not locked", index);
if (conn && (index > -1)) {
- PR_Lock(conn->c_mutex);
+ if (!locked) {
+ PR_Lock(conn->c_mutex);
+ }
if (index < conn->c_pagedresults.prl_maxlen) {
sr = conn->c_pagedresults.prl_list[index].pr_search_result_set;
}
- PR_Unlock(conn->c_mutex);
+ if (!locked) {
+ PR_Unlock(conn->c_mutex);
+ }
}
LDAPDebug1Arg(LDAP_DEBUG_TRACE,
"<-- pagedresults_get_search_result: %p\n", sr);
@@ -416,8 +421,7 @@ pagedresults_get_search_result(Connection *conn, Operation *op, int index)
}
int
-pagedresults_set_search_result(Connection *conn, Operation *op, void *sr,
- int locked, int index)
+pagedresults_set_search_result(Connection *conn, Operation *op, void *sr, int locked, int index)
{
int rc = -1;
if (!op_is_pagedresults(op)) {
@@ -1003,15 +1007,19 @@ pagedresults_unlock( Connection *conn, int index )
}
int
-pagedresults_is_abandoned_or_notavailable( Connection *conn, int index )
+pagedresults_is_abandoned_or_notavailable(Connection *conn, int locked, int index)
{
PagedResults *prp;
if (!conn || (index < 0) || (index >= conn->c_pagedresults.prl_maxlen)) {
return 1; /* not abandoned, but do not want to proceed paged results op. */
}
- PR_Lock(conn->c_mutex);
+ if (!locked) {
+ PR_Lock(conn->c_mutex);
+ }
prp = conn->c_pagedresults.prl_list + index;
- PR_Unlock(conn->c_mutex);
+ if (!locked) {
+ PR_Unlock(conn->c_mutex);
+ }
return prp->pr_flags & CONN_FLAG_PAGEDRESULTS_ABANDONED;
}
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index b10c1eb..e1cb53e 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -1445,8 +1445,7 @@ void pagedresults_set_response_control(Slapi_PBlock *pb, int iscritical,
int curr_search_count, int index);
Slapi_Backend *pagedresults_get_current_be(Connection *conn, int index);
int pagedresults_set_current_be(Connection *conn, Slapi_Backend *be, int index, int nolock);
-void *pagedresults_get_search_result(Connection *conn, Operation *op,
- int index);
+void *pagedresults_get_search_result(Connection *conn, Operation *op, int locked, int index);
int pagedresults_set_search_result(Connection *conn, Operation *op, void *sr,
int locked, int index);
int pagedresults_get_search_result_count(Connection *conn, Operation *op,
@@ -1487,7 +1486,7 @@ int pagedresults_cleanup_all(Connection *conn, int needlock);
void op_set_pagedresults(Operation *op);
void pagedresults_lock(Connection *conn, int index);
void pagedresults_unlock(Connection *conn, int index);
-int pagedresults_is_abandoned_or_notavailable(Connection *conn, int index);
+int pagedresults_is_abandoned_or_notavailable(Connection *conn, int locked, int index);
int pagedresults_set_search_result_pb(Slapi_PBlock *pb, void *sr, int locked);
/*
--
2.4.3

View file

@ -0,0 +1,43 @@
From 1a10e14ce3f05f961e80c4c8cf170d92945c25a1 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Fri, 6 Nov 2015 14:41:36 -0500
Subject: [PATCH 73/75] Ticket 48325 - Replica promotion leaves RUV out of
order
Bug Description: When promoting a consumer to a master the new RUV
element is appended to the RUV. However, when trying
to replicate from the newly promoted replica the
remote replica checks the first element in the RUV
and sees that its the same replica ID, and aborts the
replication session. Essentailly this completely
breaks replication between the two servers, and can
actually corrupt other RUVs on other replicas.
Fix Description: When promoting a replica to a master, reorder the RUV
so that it is the first in the list.
https://fedorahosted.org/389/ticket/48325
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit b896840d270a540698f35a4aac4f7a91742952b0)
(cherry picked from commit 6180b91c3f65e9c5e375816a72baa95678458a0a)
---
ldap/servers/plugins/replication/repl5_replica_config.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index e85ae3e..4d7135c 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -1003,6 +1003,7 @@ replica_config_change_type_and_id (Replica *r, const char *new_type,
csngen_rewrite_rid(gen, rid);
if(purl && type == REPLICA_TYPE_UPDATABLE){
ruv_add_replica(ruv, rid, purl);
+ ruv_move_local_supplier_to_first(ruv, rid);
replica_reset_csn_pl(r);
}
ruv_delete_replica(ruv, oldrid);
--
2.4.3

View file

@ -0,0 +1,44 @@
From 0fa9e46da9f56221b579a7729deebaed73364c27 Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Tue, 10 Nov 2015 15:35:41 -0800
Subject: [PATCH 74/75] Ticket #48344 - acl - regression - trailing ', (comma)'
in macro matched value is not removed.
Description: acl_match_macro_in_target in acl plug-in returns matched value
with a trailing comma, e.g., "o=kaki.com,". It's used to create a group DN,
e.g., "cn=Domain Administrators,ou=Groups,o=kaki.como=ace industry,c=us".
Due to the duplicated commas, the bind unexpectedly fails with 50 (insufficient
access).
In getting the matched value from target DN, it checks if a character at the
end position is a comma or not. If it is, '\0' is set there. The position
was one byte ahead. It was introduced by #48141 - aci with wildcard and macro
not correctly evaluated.
https://fedorahosted.org/389/ticket/48344
Reviewed by mreynolds@redhat.com (Thank you, Mark!!)
(cherry picked from commit 8e421fb9af2752144cc93e62090fd873524c5633)
(cherry picked from commit 1a6390d6ffa743f38be206f7ed7bb0ac3bcfe26b)
---
ldap/servers/plugins/acl/aclutil.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ldap/servers/plugins/acl/aclutil.c b/ldap/servers/plugins/acl/aclutil.c
index 2f37107..308cf8b 100644
--- a/ldap/servers/plugins/acl/aclutil.c
+++ b/ldap/servers/plugins/acl/aclutil.c
@@ -935,7 +935,7 @@ acl_match_macro_in_target( const char *ndn, char * match_this,
matched_val_len = ndn_len-macro_suffix_len-
ndn_prefix_end;
- if (ndn[ndn_len - macro_suffix_len] == ',')
+ if (ndn[ndn_len - macro_suffix_len - 1] == ',')
matched_val_len -= 1;
matched_val = (char *)slapi_ch_malloc(matched_val_len + 1);
--
2.4.3

View file

@ -0,0 +1,39 @@
From 70cdfa2ef8bcb0e8bae1c18f69c42d99dff2b5be Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Thu, 5 Nov 2015 13:08:56 -0800
Subject: [PATCH 75/75] Ticket #48339 - Share nsslapd-threadnumber in the case
nunc-stans is enabled, as well.
Description: When nunc-stans is enabled, instead of getting the
thread number from the environment variable MAX_THREADS, use the
value of config parameter nsslapd-threadnumber.
https://fedorahosted.org/389/ticket/48339
Reviewed by rmeggins@redhat.com (Thank you, Rich!!)
(cherry picked from commit ab8ed9a5ebb0d15b55d7525ed1d5dbeebd8c7563)
(cherry picked from commit a4c0a9eeba031b9304d63ca05d8b9fab9ebca1b2)
---
ldap/servers/slapd/daemon.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index bd3bfb2..5d70647 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -1199,10 +1199,7 @@ void slapd_daemon( daemon_ports_t *ports )
#ifdef ENABLE_NUNC_STANS
if (enable_nunc_stans && !g_get_shutdown()) {
int ii;
- PRInt32 maxthreads = 3;
- if (getenv("MAX_THREADS")) {
- maxthreads = atoi(getenv("MAX_THREADS"));
- }
+ PRInt32 maxthreads = (PRInt32)config_get_threadnumber();
/* Set the nunc-stans thread pool config */
ns_thrpool_config_init(&tp_config);
--
2.4.3

View file

@ -0,0 +1,57 @@
From 62d2b0026e895448b9dff76f2565012340afdfcd Mon Sep 17 00:00:00 2001
From: Noriko Hosoi <nhosoi@redhat.com>
Date: Wed, 18 Nov 2015 11:44:35 -0800
Subject: [PATCH] Ticket #48338 - SimplePagedResults -- abandon could happen
between the abandon check and sending results
Description: commit 390b8bd9076e8976facc0858e60985d6b4fac05c introduced
a self deadlock (see also bz1282607: 389-ds-base-1.2.11.15-67.el6_7 hang)
First phase of the following approach:
Fix design by Ludwig Krispenz and Rich Megginson (Thanks!)
Investigate the connection params used in the pblock access one by one and.
- for fields not used, either remove the access or just leave it as is
- With a big ASSERT to flag cases if the field is ever used, and a plan to
deprecate and remove the field.
- for fields with atomic access, like c_isreplication_session remove the mutex
- for filelds requiring copying, define them directly in the pblock and when
the pblock is created, populate them from the connection, the pblock access
would no longer need the c_mutex.
Removing PR_Lock(c_mutex) from slapi_pblock_get(SLAPI_CONN_CLIENTNETADDR) since
acquiring the lock is not necessary for the atomic reads. This change solves
the self deadlock.
https://fedorahosted.org/389/ticket/48338#comment:11
Reviewed by nkinder@redhat.com and mreynolds@redhat.com (Thank you, Nathan and Mark!)
(cherry picked from commit 79ca67d1fc5d50d8a9ae6b686b9564f3960f8592)
(cherry picked from commit 36245abd78f7abfed8219a5ac4a4cf50c1c0237c)
---
ldap/servers/slapd/pblock.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index bf57a33..f2017be 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -223,14 +223,12 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
memset( value, 0, sizeof( PRNetAddr ));
break;
}
- PR_Lock( pblock->pb_conn->c_mutex );
+ /* For fields with atomic access, remove the PR_Lock(c_mutex) */
if ( pblock->pb_conn->cin_addr == NULL ) {
memset( value, 0, sizeof( PRNetAddr ));
} else {
- (*(PRNetAddr *)value) =
- *(pblock->pb_conn->cin_addr);
+ (*(PRNetAddr *)value) = *(pblock->pb_conn->cin_addr);
}
- PR_Unlock( pblock->pb_conn->c_mutex );
break;
case SLAPI_CONN_SERVERNETADDR:
if (pblock->pb_conn == NULL)
--
2.4.3

View file

@ -34,7 +34,7 @@
Summary: 389 Directory Server (base)
Name: 389-ds-base
Version: 1.3.4.0
Release: %{?relprefix}19%{?prerel}%{?dist}
Release: %{?relprefix}21%{?prerel}%{?dist}
License: GPLv2 with exceptions
URL: http://port389.org/
Group: System Environment/Daemons
@ -191,6 +191,14 @@ Patch64: 0065-Ticket-48266-do-not-free-repl-keep-alive-entry-on-er.patc
Patch65: 0066-Ticket-48299-pagedresults-when-timed-out-search-resu.patch
Patch66: 0067-Ticket-48192-Individual-abandoned-simple-paged-resul.patch
Patch67: 0068-Ticket-48298-ns-slapd-crash-during-ipa-replica-manag.patch
Patch68: 0069-Ticket-48311-nunc-stans-Attempt-to-release-connectio.patch
Patch69: 0070-Ticket-48311-nunc-stans-Attempt-to-release-connectio.patch
Patch70: 0071-Ticket-47976-deadlock-in-mep-delete-post-op.patch
Patch71: 0072-Ticket-48338-SimplePagedResults-abandon-could-happen.patch
Patch72: 0073-Ticket-48325-Replica-promotion-leaves-RUV-out-of-ord.patch
Patch73: 0074-Ticket-48344-acl-regression-trailing-comma-in-macro-.patch
Patch74: 0075-Ticket-48339-Share-nsslapd-threadnumber-in-the-case-.patch
Patch75: 0076-Ticket-48338-SimplePagedResults-abandon-could-happen.patch
%description
389 Directory Server is an LDAPv3 compliant server. The base package includes
@ -322,6 +330,14 @@ cp %{SOURCE2} README.devel
%patch65 -p1
%patch66 -p1
%patch67 -p1
%patch68 -p1
%patch69 -p1
%patch70 -p1
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74 -p1
%patch75 -p1
%build
%if %{use_nunc_stans}
@ -516,6 +532,19 @@ fi
%endif
%changelog
* Wed Nov 18 2015 Noriko Hosoi <nhosoi@redhat.com> - 1.3.4.0-21
- release 1.3.4.0-21
- Resolves: bug 1278730 - SimplePagedResults -- abandon could happen between the abandon check and sending results -- Fixing a regression introduced in 1.3.4.0-20 (DS 48338)
* Thu Nov 12 2015 Noriko Hosoi <nhosoi@redhat.com> - 1.3.4.0-20
- release 1.3.4.0-20
- Resolves: bug 1278729 - Share nsslapd-threadnumber in the case nunc-stans is enabled (DS 48339)
- Resolves: bug 1278730 - SimplePagedResults -- abandon could happen between the abandon check and sending results (DS 48338)
- Resolves: bug 1279572 - Cannot upgrade a consumer to supplier in a multimaster environment (DS 48325)
- Resolves: bug 1279573 - nunc-stans: Attempt to release connection that is not acquired (DS 48311)
- Resolves: bug 1280210 - deadlock in mep delete post op (DS 47976)
- Resolves: bug 1281522 - acl - regression - trailing ', (comma)' in macro matched value is not removed (DS 48344)
* Mon Oct 5 2015 Noriko Hosoi <nhosoi@redhat.com> - 1.3.4.0-19
- release 1.3.4.0-19
- Resolves: bug 1228823 - async simple paged results issue (DS 48299, DS 48192)