[PATCH] Avoid extra talloc in ctdb marshal buffer

Michael Adam obnox at samba.org
Wed Jul 23 05:41:57 MDT 2014


On 2014-07-16 at 18:06 +1000, Amitay Isaacs wrote:
> On Thu, Jul 10, 2014 at 6:53 PM, Amitay Isaacs <amitay at gmail.com> wrote:
> >
> > This patch converted the code without changing behavior.  However, looking
> > at the code, it does seem wrong.  I have added an extra patch in the
> > beginning that fails traverse if talloc_realloc fails.  In that case, we
> > leave the function and clean up all temporary memory.
> >
> 
> Volker,
> 
> Do you have any comments on the extra patch?
>
> May be Michael has some suggestion?

Sorry for being so late.
Thankfully, Volker has already reviewed these!

I have one more comment on the additional patch
fa4a81c86b6073b2563b090aa657d8e8b63c1276
"ctdb-vacuum: If talloc_realloc fails, terminate traverse"

Originally I thought that we should try to vacuum on
as much as possible even when an error occurs, but I
guess you are right in that malloc error should terminate
the whole vacuum effort (in this run).

But there is one omission:

There are two calls of traversing the delete_list for
marshalling: the first one only indirectly calls the
delete_marshall_traverse() callback via the wrapper
delete_marshall_traverse_first().

So I think also in the first traversal we should
"goto done" upon traverse error.

According patch is attached for review/push.

Cheers - Michael


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ctdb-vacuum-stop-vacuuming-when-the-first-delete_lis.patch
Type: text/x-diff
Size: 977 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140723/cd477e3e/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140723/cd477e3e/attachment.pgp>


More information about the samba-technical mailing list