]> arthur.barton.de Git - bup.git/commit
git.py: flush idx_map before close so FILE* operations will see changes.
authorRob Browning <rlb@defaultvalue.org>
Sat, 8 Jun 2013 15:25:33 +0000 (10:25 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sat, 8 Jun 2013 15:26:36 +0000 (10:26 -0500)
commitab2cef40af6a4c1adeb0f3ffb40e8ffa7530d5c6
treec875dd78ecb5cbc68204bf9e1335fd79403a0c84
parent91b23d50390bc555063a0c6863b31b19b3fd99dc
git.py: flush idx_map before close so FILE* operations will see changes.

Flush idx_map (msync()) before closing it, since it doesn't look like
POSIX guarantees that a matching FILE* (i.e. idx_f) will see the
parallel changes if we don't.

From the original report:

  After `bup save`, `git fsck` would show messages like
  "Packfile index for %s SHA1 mismatch"
  This indicated a bad trailing checksum on the pack index file.

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