]> arthur.barton.de Git - bup.git/commit
Stop interleaving stream and mmap IO operations when writing the index.
authorRob Browning <rlb@defaultvalue.org>
Fri, 23 Aug 2013 03:57:03 +0000 (22:57 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 7 Sep 2013 22:51:09 +0000 (17:51 -0500)
commit54da1af7ad60254f3b0fc42baa0af72f6c7ac1bf
treee71a458cfa849acdc1a75445e0a458aff5801b91
parentbfa418544ef05efd8b8cca9150d23922f2318205
Stop interleaving stream and mmap IO operations when writing the index.

Previously bup would write the index via a simultaneous combination of
stream operations and mmap writes to non-overlapping, but adjacent
regions of the same file.  This was causing index corruption in some
cases.

Instead, make an extra pass over the data in memory to precompute the
size of the final index section, which contains any 31+-bit offsets.
Then mmap and write the entire set of tables directly, avoiding the
need for simultaneous stream operations.

Reported-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Greg Troxel <gdt@lexort.com>
Reviewed-by: Greg Troxel <gdt@lexort.com>
lib/bup/_helpers.c
lib/bup/git.py