commit | 22f226245a1c399be7d2890d50fd56aadf49ebbe | [log] [tgz] |
---|---|---|
author | Eric Biggers <ebiggers@google.com> | Thu Nov 05 19:09:37 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Nov 05 19:09:37 2020 +0000 |
tree | 97eb3931bae7402e983315b421bd37f54a29c5f4 | |
parent | ee175c954a25454969860ddf19bc884ed3022fd0 [diff] | |
parent | e244a15f34ae2e85e3f5b40be0bf252e37eab56b [diff] |
Merge "EncryptInplace: fsync cryptofd before reporting success" am: e244a15f34 Original change: https://android-review.googlesource.com/c/platform/system/vold/+/1488376 Change-Id: I10ff2f5cccf00fbd3cbac93059ce7f069911e9c4
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;