This repository was archived by the owner on May 6, 2020. It is now read-only.
sync: Flush all caches when destroying the pod#169
Merged
Conversation
sboeuf
commented
Nov 16, 2017
When DESTROYPOD command is called, this means the VM is going to be shut down right after. Because we don't want to shut down the VM with some pending buffers, this patch calls into sync() system call to make sure all buffers are flushed. From sync() man page: "According to the standard specification (e.g., POSIX.1-2001), sync() schedules the writes, but may return before the actual writing is done. However Linux waits for I/O completions, and thus sync() or syncfs() provide the same guarantees as fsync called on every file in the system or filesystem respectively." This will ensure that sync() will block until all buffers are properly flushed. Fixes #168 Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.