mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
5042fcc0e0
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 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
RevisionStore.cpp | ||
RevisionStore.h |