[PATCH] Avoid extra talloc in ctdb marshal buffer

Amitay Isaacs amitay at gmail.com
Wed Jul 23 07:02:09 MDT 2014


On Wed, Jul 23, 2014 at 9:41 PM, Michael Adam <obnox at samba.org> wrote:

> 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
>

Agreed.  Pushed to autobuild.

Amitay.


More information about the samba-technical mailing list