mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
1ad184455b
Summary: This diff implements FSCK for EdenFS Windows. On Windows, users can still modify EdenFS mounts even when EdenFS is not running, which may cause mismatch between EdenFS state and on-disk view. This subsequently may cause issues when EdenFS is running again (such as permission error, not seeing added entries in `hg status`, etc..). This diff adds FSCK to EdenFS Windows. It is not exactly same as what fsck traditionally do on *NIX systems. We are still dubbing it as FSCK since it works at the same place as eden fsck. At startup, FSCK will crawl the EdenFS mount to compare the overlay state with disk state. It then synchronizes the overlay view with what the user has on disk. Note Windows does not always permit user to modify the mount, it only allows changes in certain situation. In particular, when the directory is in Full state, this diff takes advantage of that so we can finish the scanning by only scans such directories. One limitation of Windows FSCK is that, it cannot reliably tell if the user deleted a directory or file from dirty placeholder directories. This is because ProjectedFS will hide untouched entries under dirty placeholder directory when EdenFS is not running, and there is no way we can tell if the entry is gone because of user deletion or hid by ProjectedFS. This is not perfect but acceptable to some extent. One possible failure scenario is: 1. User creates a directory named `foo`. 2. User writes a file to that directory (`foo/bar`). 3. EdenFS then stops running. 4. User then deletes the entire `foo` directory on disk. 5. EdenFS starts again, `foo` will be recrated with an empty `bar` file. This will still correctly show in `hg status`, and the user is able to delete them again. Reviewed By: xavierd Differential Revision: D27872753 fbshipit-source-id: c553db568379062ff4504204c1a1785664f87c00 |
||
---|---|---|
.. | ||
test | ||
CMakeLists.txt | ||
TreeOverlay.cpp | ||
TreeOverlay.h | ||
TreeOverlayScanner.cpp | ||
TreeOverlayStore.cpp | ||
TreeOverlayStore.h | ||
TreeOverlayWindowsFsck.cpp | ||
TreeOverlayWindowsFsck.h |