[PATCH] make schannel.tdb TDB_CLEAR_IF_FIRST
idra at samba.org
Mon Jun 28 06:26:41 MDT 2010
On Fri, 2010-06-25 at 09:08 +1000, Andrew Bartlett wrote:
> On Thu, 2010-06-24 at 16:43 +0200, Volker Lendecke wrote:
> > On Thu, Jun 24, 2010 at 09:22:53AM +1000, Andrew Bartlett wrote:
> > > Attached again is my proposed set of changes. They pass 'make test' in
> > > Samba3 and Samba4, and I've manually verified that the
> > > TDB_CLEAR_IF_FIRST behaviour is applied correctly (by inspection with
> > > tdbdump while conduction schannel operations against Samba3)
> > >
> > > I think I've followed the pattern given above correctly. If someone
> > > could please push/review/comment I would very much appreciate it.
> > The changes technically look ok. In particular, as we should
> > remove all non CLEAR_IF_FIRST uses of tdb without
> > transactions. I just wonder where the fsyncs in your tests
> > come from. I have always thought that tdb does not do fsyncs
> > when no transactions are used, but I might be wrong.
> > Can you explain where the fsync calls in your test come
> > from?
> Yes, this TDB uses transactions to ensure the updates are safe
> (inherited from gd's conversion of this functionality from ldb, which
> used transactions). I guess that now that it is CLEAR_IF_FIRST then we
> could use normal tdb locking rather than needing the lock out the whole
> DB for exclusive access.
> I would however like to leave that for a subsequent patch, if that's OK.
> (We would need all of this change anyway, and I need to carefully
> consider the required semantics).
When I converted this schannel DB from ldb to tdb I realized the
transaction is necessary to avoid races IIRC. Otherwise I would have
removed it already.
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