Merge "libsnapshot: Allow multiple calls to FinishedSnapshotWrites"
am: 09a0c98506
Change-Id: If259e2d4a9663575198aa1b14e13a4c9a50cf1e7
This commit is contained in:
commit
ab13ed350e
1 changed files with 7 additions and 1 deletions
|
|
@ -152,7 +152,13 @@ bool SnapshotManager::FinishedSnapshotWrites() {
|
|||
auto lock = LockExclusive();
|
||||
if (!lock) return false;
|
||||
|
||||
if (ReadUpdateState(lock.get()) != UpdateState::Initiated) {
|
||||
auto update_state = ReadUpdateState(lock.get());
|
||||
if (update_state == UpdateState::Unverified) {
|
||||
LOG(INFO) << "FinishedSnapshotWrites already called before. Ignored.";
|
||||
return true;
|
||||
}
|
||||
|
||||
if (update_state != UpdateState::Initiated) {
|
||||
LOG(ERROR) << "Can only transition to the Unverified state from the Initiated state.";
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue