Merge "EncryptInplace: fsync cryptofd before reporting success"
This commit is contained in:
commit
e244a15f34
1 changed files with 5 additions and 0 deletions
|
@ -345,6 +345,11 @@ bool InPlaceEncrypter::EncryptInPlace(const std::string& crypto_blkdev,
|
|||
|
||||
if (success) success &= EncryptPendingData();
|
||||
|
||||
if (success && fsync(cryptofd_) != 0) {
|
||||
PLOG(ERROR) << "Error syncing " << crypto_blkdev_;
|
||||
success = false;
|
||||
}
|
||||
|
||||
if (!success) {
|
||||
LOG(ERROR) << "In-place encryption of " << DescribeFilesystem() << " failed";
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue