TDB on OpenBSD problem.

Jeremy Allison jeremy at
Fri May 4 16:16:15 GMT 2001

On Fri, May 04, 2001 at 06:38:43AM -0700, tridge at wrote:
> > I think I've just reproduced it using tdbtorture on a OpenBSD vmware
> > session. I'm looking into it.
> I now have a tiny test program that shows the basic problem. It seems
> that on OpenBSD mmap and read are not coherent. I've written to Theo
> to ask him about it.
> Can those of you seeing the tdb expansion bug please try the following
> test program and see if it reports an error.
> btw, I think we could make tdb not rely on mmap/read coherence, but
> I'd rather first understand whats going on. 

Well tracked down ! That's a *nasty* one.

If the mmap worked I didn't think we used read() at all
in the tdb code. The only case where we need coherence
between the mmap and the read()/write() system is on
tdb_expand(), where we do lseek()->write() then
munmap()->mmap(). I wonder if we reversed the calls to
lseek()->write() followed by munmap()->mmap() to be
munmap() -> lseek() -> write() -> mmap() if it would fix
the problem ?

We can't close the file before doing this as  we need 
to retain the global fcntl() database lock in tdb_expand().

Can anyone give me an ssh access to an OpenBSD system
so I can modify the test to work on this theory. Either
that or Andrew if you could point me at your vmware image
I can work in that.



Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba-technical mailing list