Merge "EncryptInplace: fsync cryptofd before reporting success"

This commit is contained in:
Eric Biggers 2020-11-05 18:51:13 +00:00 committed by Gerrit Code Review
commit e244a15f34

View file

@ -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;