database copying and compacting

Pavel Kankovsky peak at argo.troja.mff.cuni.cz
Fri Nov 19 17:35:58 CET 2004


On Mon, 15 Nov 2004, Matthias Andree wrote:

> No. bogofilter -f $DST is possible, but db_recover MUST NOT be used on
> live databases.

$DST is not a "live database". It's a copy we've just created with cp
and dd.

> Yup. The actual problem was that on some systems, cp(1) used mmap(2)
> which then goofed the isolation up and caused non-atomic reads. Half a
> page new, the other half stale. [...]

The bad news is the Linux kernel (at least late 2.4 and 2.6) violates this
guarantee, ie. it does not make sure writes are atomic wrt reads (but it
makes sure they are atomic wrt other writes). This is, of course, a
violation of POSIX. I was ignored when I pointed it out on LKML (see
"Linux kernel file offset pointer races" in August, esp. my post from Aug
12). As far as I can tell, interleaving of reads and writes can happen
even in the middle of a page. :P


--Pavel Kankovsky aka Peak  [ Boycott Microsoft--http://www.vcnet.com/bms ]
"Resistance is futile. Open your source code and prepare for assimilation."




More information about the Bogofilter mailing list