summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-12-27 12:45:42 +0100
committerKarolin Seeger <kseeger@samba.org>2019-08-08 07:32:22 +0000
commit5a3fa18389b76bb31541e8b93de8353fa6b548d7 (patch)
treea7e318f25522510be6ef2b85f50e0bb9f69fdd56 /source3/lib
parenta4ad9d6e7cfdd1be1ea71f08ce5b6c404260281e (diff)
downloadsamba-5a3fa18389b76bb31541e8b93de8353fa6b548d7.tar.gz
Revert "s3:messages: allow messaging_{dgm,ctdb}_register_tevent_context() to use wrapper tevent_context"
This reverts commit 660cf86639753edaa7a7a21a5b5ae207ae7d4260. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14033 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 1c3676f3aa9c1564eb140a24ced5ee72b859b87f)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/messages_ctdb.c38
-rw-r--r--source3/lib/messages_dgm.c38
2 files changed, 18 insertions, 58 deletions
diff --git a/source3/lib/messages_ctdb.c b/source3/lib/messages_ctdb.c
index 11fe72661cc..a1aeb37af19 100644
--- a/source3/lib/messages_ctdb.c
+++ b/source3/lib/messages_ctdb.c
@@ -209,6 +209,14 @@ struct messaging_ctdb_fde *messaging_ctdb_register_tevent_context(
return NULL;
}
+ if (tevent_context_is_wrapper(ev)) {
+ /*
+ * This is really a programmer error!
+ */
+ DBG_ERR("Should not be used with a wrapper tevent context\n");
+ return NULL;
+ }
+
fde = talloc(mem_ctx, struct messaging_ctdb_fde);
if (fde == NULL) {
return NULL;
@@ -226,24 +234,7 @@ struct messaging_ctdb_fde *messaging_ctdb_register_tevent_context(
*/
continue;
}
-
- /*
- * We can only have one tevent_fd
- * per low level tevent_context.
- *
- * This means any wrapper tevent_context
- * needs to share the structure with
- * the main tevent_context and/or
- * any sibling wrapper tevent_context.
- *
- * This means we need to use tevent_context_same_loop()
- * instead of just (fde_ev->ev == ev).
- *
- * Note: the tevent_context_is_wrapper() check below
- * makes sure that fde_ev->ev is always a raw
- * tevent context.
- */
- if (tevent_context_same_loop(fde_ev->ev, ev)) {
+ if (fde_ev->ev == ev) {
break;
}
}
@@ -251,17 +242,6 @@ struct messaging_ctdb_fde *messaging_ctdb_register_tevent_context(
if (fde_ev == NULL) {
int sock = ctdbd_conn_get_fd(ctx->conn);
- if (tevent_context_is_wrapper(ev)) {
- /*
- * This is really a programmer error!
- *
- * The main/raw tevent context should
- * have been registered first!
- */
- DBG_ERR("Should not be used with a wrapper tevent context\n");
- return NULL;
- }
-
fde_ev = talloc(fde, struct messaging_ctdb_fde_ev);
if (fde_ev == NULL) {
return NULL;
diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index 90d253d8e26..60ac9988db7 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -1695,6 +1695,14 @@ struct messaging_dgm_fde *messaging_dgm_register_tevent_context(
return NULL;
}
+ if (tevent_context_is_wrapper(ev)) {
+ /*
+ * This is really a programmer error!
+ */
+ DBG_ERR("Should not be used with a wrapper tevent context\n");
+ return NULL;
+ }
+
fde = talloc(mem_ctx, struct messaging_dgm_fde);
if (fde == NULL) {
return NULL;
@@ -1712,40 +1720,12 @@ struct messaging_dgm_fde *messaging_dgm_register_tevent_context(
*/
continue;
}
-
- /*
- * We can only have one tevent_fd
- * per low level tevent_context.
- *
- * This means any wrapper tevent_context
- * needs to share the structure with
- * the main tevent_context and/or
- * any sibling wrapper tevent_context.
- *
- * This means we need to use tevent_context_same_loop()
- * instead of just (fde_ev->ev == ev).
- *
- * Note: the tevent_context_is_wrapper() check below
- * makes sure that fde_ev->ev is always a raw
- * tevent context.
- */
- if (tevent_context_same_loop(fde_ev->ev, ev)) {
+ if (fde_ev->ev == ev) {
break;
}
}
if (fde_ev == NULL) {
- if (tevent_context_is_wrapper(ev)) {
- /*
- * This is really a programmer error!
- *
- * The main/raw tevent context should
- * have been registered first!
- */
- DBG_ERR("Should not be used with a wrapper tevent context\n");
- return NULL;
- }
-
fde_ev = talloc(fde, struct messaging_dgm_fde_ev);
if (fde_ev == NULL) {
return NULL;