[PATCH] Remove all uses of talloc_autofree_context() from our code (except for test)

Jeremy Allison jra at samba.org
Tue Jul 25 20:34:56 UTC 2017


On Tue, Jul 25, 2017 at 01:28:01PM -0700, Jeremy Allison via samba-technical wrote:
> On Wed, Jul 26, 2017 at 08:13:59AM +1200, Andrew Bartlett wrote:
> > On Tue, 2017-07-25 at 13:04 -0700, Jeremy Allison via samba-technical
> > wrote:
> > > On Tue, Jul 25, 2017 at 09:58:06PM +0200, Volker Lendecke wrote:
> > > > On Tue, Jul 25, 2017 at 12:37:24PM -0700, Jeremy Allison wrote:
> > > > > > Does "smbcontrol smbd pool-usage" still work after this change?
> > > > > 
> > > > > No. If we're not using the global null_context within
> > > > > talloc anymore, then pool usage doesn't have a central
> > > > > place to track all allocations off it.
> > > > 
> > > > That's tough. I definitely want pool-usage to be available everywhere
> > > > and always. When you need it, it's too late to activate it.
> > > 
> > > Having it available "everywhere and always" is inconsistent
> > > with the design criteria behind this patchset. For that you
> > > need a completely MT-safe talloc - you know it and I know it :-).
> > > 
> > > If you'd have mentioned that in the beginning then I wouldn't
> > > have spent literally *months* of work getting this done and
> > > cleaning up the code to this state.
> > 
> > It wasn't ever mentioned as a required casualty Jermey, Sorry.
> > 
> > I always assumed this work was about libsmbclient etc, making our
> > libraries not suck when used MT.
> 
> As pointed out by Volker on the phone, I'm conflating two issues here :-).
> 
> Using talloc_autofree_context() has been the cause of some
> mightily lazy shitty API design issues, so let's get rid of
> that.
> 
> Making talloc fully MT-safe is a larger issue, and removing
> the talloc_enable_null_tracking() call is part of that,
> and not the design issue problem.
> 
> So I've asked him to review (and possibly ACK) the
> first 14 patches, and NAK the last one that removes
> the talloc_enable_null_tracking().
> 
> That way I get talloc_autofree_context() removed from
> our code and hopefully will prevent anyone from
> re-adding it, but you all still get "smbcontrol smbd pool-usage"
> still working.

FYI, I just tested and ensured that that combination
of patches still preserves the "smbcontrol smbd pool-usage"
output correctly.



More information about the samba-technical mailing list