lib/tdb: fix transaction issue for HAVE_INCOHERENT_MMAP.
authorRusty Russell <rusty@rustcorp.com.au>
Fri, 23 Mar 2012 00:15:18 +0000 (10:45 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 23 Mar 2012 01:53:15 +0000 (02:53 +0100)
commit4442c0b2c92e4b2e88661e15022228c5f6547112
treeceae95a83ff2c21ed57bfacac66dee324a34316c
parentc12970cc91cb4da8976801e194e29e33e02b340a
lib/tdb: fix transaction issue for HAVE_INCOHERENT_MMAP.

We unmap the tdb on expand, the remap.  But when we have INCOHERENT_MMAP
(ie. OpenBSD) and we're inside a transaction, doing the expand can mean
we need to read from the database to partially fill a transaction block.
This fails, because if mmap is incoherent we never allow accessing the
database via read/write.

The solution is not to unmap and remap until we've actually written the
padding at the end of the file.

Reported-by: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Fri Mar 23 02:53:15 CET 2012 on sn-devel-104
lib/tdb/common/io.c