sapling/lib/revisionstore
Xavier Deguillard 5042fcc0e0 revisionstore: always write to the end of the MutableDataPack
Summary:
We've recently had issues with our Python implementation of MutableDataPack,
and careful audit of this code from DurhamG revealed that the Rust code had a
small issue too.

If the read_entry function fails in between the 2 seeks, the file position
won't be at the end of the file when add is called, potentially corrupting the
content of the file.

The previous solution chosen just involves panicing if the SeekFrom::End fails,
as there is no real good ways of recovering from it failing, unless we want to
add lots of complexity to the code.

This diff changes it to use O_APPEND at open time so the kernel would always
seek to the end of the file on write(2).

Reviewed By: quark-zju

Differential Revision: D16037868

fbshipit-source-id: 60ffcd3eb256b3854fb2e816cf1f289a1ef92ef6
2019-07-03 19:15:05 -07:00
..
src revisionstore: always write to the end of the MutableDataPack 2019-07-03 19:15:05 -07:00
Cargo.toml revisionstore: add an indexedlog backed content store 2019-04-10 10:34:34 -07:00
RevisionStore.cpp load blobs using hg's rust config and datapack code 2018-10-31 17:58:17 -07:00
RevisionStore.h load blobs using hg's rust config and datapack code 2018-10-31 17:58:17 -07:00