Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: Potential problem in git-add may corrupt the index file

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:39

Gang Hu [off-list ref] writes:
If a crash happens after the rename(), the data may have not been
completely flushed into the index file, so the user may face an empty
or corrupted index file.
Yeah, probably we should add fsync_or_die() at the end of write_index()
in read-cache.c, possibly protect it with fsync_object_files just like
we do in close_sha1_file() in sha1_file.c for loose object files.

I think the real fix would be to update the write_index() codepath to
use the csum-file API, though.  Then sha1close() will give us the fsync
behaviour for free.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help