[PATCH] Make tdb a bit more robust against corrupt tdbs

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Oct 8 19:13:38 UTC 2018


On Mon, Oct 08, 2018 at 12:00:15PM -0700, Jeremy Allison wrote:
> On Fri, Oct 05, 2018 at 03:24:03PM +0200, Volker Lendecke via samba-technical wrote:
> > Hi!
> > 
> > Attached find a few patches that make tdb a bit more robust against
> > tdbs that contain circular hash chains. I did not cover all instances
> > where we walk chains, but this might be a step in the right direction.
> > Without these patches we sit in 100% cpu loops when we hit such a
> > condition.
> > 
> > The main one I did not touch yet is tdb_traverse. This is particularly
> > difficult as the hash chain can change while we are traversing it. So
> > we can't use the trick from rescue.c with the slow ptr.
> > 
> > To enable imprecise, but safe traverse for a limited set of use cases
> > I'm considering to write a function that will just marshall a complete
> > hash chain into a predefined buffer. This should be really, really
> > fast and should be good for background cleanup tasks. The main target
> > here is gencache, which we don't clean up at all yet.
> > 
> > Comments?
> 
> This code is really clever, thanks for the out-of-band explaination !

It's Rusty Russell's idea, see 90f463b25f7bb0bc. I just put a wrapper
around it :-)

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de



More information about the samba-technical mailing list