sapling/eden/fs
Matt Glazar 7697a170be Synchronize mount+unmount 3/4: Make unmount succeed if not mounted
Summary:
I want to make EdenMount robust if mounting and unmounting are requested concurrently. This will make it safer to call EdenMount::destroy in different situations.

Take a step toward that goal by making EdenMount::unmount succeed if EdenMount::startFuse was never called.

Changed behaviors:

* If neither EdenMount::startFuse nor EdenMount::takeoverFuse was never called, EdenMount::unmount succeeds and does not call PrivHelper::fuseUnmount.
  * **Old behavior**: EdenMount::unmount fails with an exception from PrivHelper.

Unchanged behaviors:

* If EdenMount::unmount was ever called, EdenMount::startFuse fails with EdenMountCancelled.
* If EdenMount::unmount was ever called, EdenMount::takeoverFuse fails with EdenMountCancelled.
* If EdenMount::startFuse is in progress, EdenMount::unmount causes the concurrent startFuse call to fail with FuseDeviceUnmountedDuringInitialization.
* If EdenMount::startFuse -> PrivHelper::fuseMount is in progress, EdenMount::unmount waits for fuseMount to finish before calling PrivHelper::fuseUnmount.
* If EdenMount::startFuse -> PrivHelper::fuseMount is complete, EdenMount::unmount calls PrivHelper::fuseUnmount immediately.
* If EdenMount::takeoverFuse is in progress, EdenMount::unmount does not cause EdenMount::takeoverFuse to fail.
* if EdenMount::takeoverFuse was called, EdenMount::unmount calls PrivHelper::fuseUnmount immediately.
* If EdenMount::unmount is called multiple times, one of the calls succeeds, and the remaining calls to unmount fail with an exception from PrivHelper.

Reviewed By: simpkins

Differential Revision: D14398537

fbshipit-source-id: 9209aad8b2980045fd0f89a5ba149a833579c2cf
2019-03-21 13:51:15 -07:00
..
benchharness standardize some of the benchmark infrastructure 2018-11-13 15:27:50 -08:00
config Use FileUtil APIs on Windows 2019-03-18 10:00:32 -07:00
fuse add osxfuse kernel header 2019-03-19 10:26:24 -07:00
inodes Synchronize mount+unmount 3/4: Make unmount succeed if not mounted 2019-03-21 13:51:15 -07:00
journal Add assorted missing includes 2019-03-07 00:13:47 -08:00
model Add assorted missing includes 2019-03-07 00:13:47 -08:00
rocksdb attempt to repair the RocksDB if we fail to open it 2019-03-18 11:36:42 -07:00
service Added UserInfo for Windows 2019-03-20 14:16:50 -07:00
sqlite avoid leaking the sqlite3 db if we fail to open it 2018-06-20 16:36:22 -07:00
store Use hg import subcommand on Windows 2019-03-20 21:50:50 -07:00
takeover Add missing copyright notices 2019-03-07 19:32:39 -08:00
testharness Synchronize mount+unmount 0/4: Add features to MountDelegate test helpers 2019-03-21 13:51:15 -07:00
tracing eden: add missing cmake for eden/fs/tracing 2018-12-15 19:11:05 -08:00
utils Add assorted missing includes 2019-03-07 00:13:47 -08:00
CMakeLists.txt fix oss macOS build 2019-03-18 14:12:57 -07:00