commit | e244a15f34ae2e85e3f5b40be0bf252e37eab56b | [log] [tgz] |
---|---|---|
author | Eric Biggers <ebiggers@google.com> | Thu Nov 05 18:51:13 2020 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Thu Nov 05 18:51:13 2020 +0000 |
tree | 97eb3931bae7402e983315b421bd37f54a29c5f4 | |
parent | 91e4f1dd76ec9ca1d76ec52033bea5a0a2c20fb9 [diff] | |
parent | 1ba8865fec2e58dc1a886c2175bea38cbac8ffee [diff] |
Merge "EncryptInplace: fsync cryptofd before reporting success"
diff --git a/EncryptInplace.cpp b/EncryptInplace.cpp index 8baed78..057b3ef 100644 --- a/EncryptInplace.cpp +++ b/EncryptInplace.cpp
@@ -345,6 +345,11 @@ 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;