What is required to make schannel.tdb TDB_CLEAR_IF_FIRST

simo idra at samba.org
Sat Jun 12 08:21:13 MDT 2010

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

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.


Simo Sorce
Samba Team GPL Compliance Officer <simo at samba.org>
Principal Software Engineer at Red Hat, Inc. <simo at redhat.com>

More information about the samba-technical mailing list