What is required to make schannel.tdb TDB_CLEAR_IF_FIRST

Andrew Bartlett abartlet at samba.org
Sat Jun 12 16:35:47 MDT 2010


On Sat, 2010-06-12 at 10:21 -0400, simo wrote:
> On Sat, 2010-06-12 at 18:23 +1000, Andrew Bartlett wrote:
> > The semantics of schannel are quite clear (from windows behaviour on
> > reboots), that it is reasonable to reset this database - schannel.tdb -
> > at any time.  
> > 
> > As such, it should be an ideal candidate for TDB_CLEAR_IF_FIRST.  What
> > I'm wondering is, what do I need to do to implement this?  What are the
> > rules about TDB_CLEAR_IF_FIRST databases, and how do I set one up
> > correctly?
> > 
> > I'm asking this because my new ext4 based development system seems to
> > spend a very, very large amount of time in fsync() due to schannel
> > operations, whenever I'm doing a Samba4 'make test'.   
> > 
> > (I know there is a hack patch to disable fsync here in metze's repo
> > somewhere, but that's not the point...)
> 
> Hi Andrew,
> when I worked on schannel.tdb I considered using NOSYNC and
> TDB_CLEAR_IF_FIRST (necessary if you do not guarantee consistency).
> 
> The reason I didn't do that is that Metze felt we should not loose the
> database if we stop and restart samba. That's what would happen with
> TDB_CLEAR_IF_FIRST.

Yeah. 

> If resetting the schannel.tdb with a "service smb restart" is fine then
> we can certainly use TDB_CLEAR_IF_FIRST and stop paying the price of
> syncing the file.

I think we gain far more by killing the fsync() and allowing format
changes than we gain by allowing restarts. 

Can you remind me what I have to do to set that up?  The idea would be
to create a helper function that opens the DB, and call that from the
main() of Samba3's smbd and Samba4's server, right?  I then 'open' it
again in the schannel code with TDB_CLEAR_IF_FIRST and the rest is
magic?

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100613/3fee4527/attachment.pgp>


More information about the samba-technical mailing list