The Samba-Bugzilla – Attachment 13803 Details for
Bug 13152
Fix memory hierarchy of deferred requests waiting for readonly revoke
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patches for v4-7
BZ13152-v4-7.patch (text/plain), 2.31 KB, created by
Amitay Isaacs
on 2017-11-22 04:32:41 UTC
(
hide
)
Description:
Patches for v4-7
Filename:
MIME Type:
Creator:
Amitay Isaacs
Created:
2017-11-22 04:32:41 UTC
Size:
2.31 KB
patch
obsolete
>From 67a7b3c67253b86f2139d10cbcb0711414fa49e0 Mon Sep 17 00:00:00 2001 >From: Amitay Isaacs <amitay@gmail.com> >Date: Thu, 19 Oct 2017 14:58:18 +1100 >Subject: [PATCH] ctdb-daemon: Allocate deferred calls off calling context > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=13152 > >This makes sure that if a client disconnects, all the deferred calls >from the client are correctly freed. > >Signed-off-by: Amitay Isaacs <amitay@gmail.com> >Reviewed-by: Martin Schwenke <martin@meltin.net> >(cherry picked from commit 848f2425984667c243ccac847b8f48a66ce10178) >--- > ctdb/server/ctdb_call.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c >index 5b2e2f5a02e..17d6f98e37c 100644 >--- a/ctdb/server/ctdb_call.c >+++ b/ctdb/server/ctdb_call.c >@@ -1549,6 +1549,7 @@ struct revokechild_deferred_call { > struct ctdb_req_header *hdr; > deferred_requeue_fn fn; > void *ctx; >+ struct revokechild_handle *rc; > }; > > struct revokechild_handle { >@@ -1573,12 +1574,20 @@ static void deferred_call_requeue(struct tevent_context *ev, > while (dlist != NULL) { > struct revokechild_deferred_call *dcall = dlist; > >+ talloc_set_destructor(dcall, NULL); > DLIST_REMOVE(dlist, dcall); > dcall->fn(dcall->ctx, dcall->hdr); > talloc_free(dcall); > } > } > >+static int deferred_call_destructor(struct revokechild_deferred_call *dcall) >+{ >+ struct revokechild_handle *rc = dcall->rc; >+ >+ DLIST_REMOVE(rc->deferred_call_list, dcall); >+ return 0; >+} > > static int revokechild_destructor(struct revokechild_handle *rc) > { >@@ -1917,7 +1926,7 @@ int ctdb_add_revoke_deferred_call(struct ctdb_context *ctdb, struct ctdb_db_cont > return -1; > } > >- deferred_call = talloc(ctdb_db, struct revokechild_deferred_call); >+ deferred_call = talloc(call_context, struct revokechild_deferred_call); > if (deferred_call == NULL) { > DEBUG(DEBUG_ERR,("Failed to allocate deferred call structure for revoking record\n")); > return -1; >@@ -1927,6 +1936,9 @@ int ctdb_add_revoke_deferred_call(struct ctdb_context *ctdb, struct ctdb_db_cont > deferred_call->hdr = talloc_steal(deferred_call, hdr); > deferred_call->fn = fn; > deferred_call->ctx = call_context; >+ deferred_call->rc = rc; >+ >+ talloc_set_destructor(deferred_call, deferred_call_destructor); > > DLIST_ADD(rc->deferred_call_list, deferred_call); > >-- >2.13.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
martins
:
review+
Actions:
View
Attachments on
bug 13152
:
13802
| 13803