From ac4701de1b28b34fd41973feaf85c9a8a49f3c5c Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Wed, 4 Nov 2015 11:43:58 -0800 Subject: uncrypt: remove O_SYNC to avoid time-out failures This patch removes costly O_SYNC flag for encrypted block device. After writing whole decrypted blocks, fsync should guarantee their consistency from further power failures. This patch reduces the elapsed time significantly consumed by upgrading packages on an encrypted partition, so that it could avoid another time-out failures too. Change-Id: I1fb9022c83ecc00bad09d107fc87a6a09babb0ec Signed-off-by: Jaegeuk Kim --- uncrypt/uncrypt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'uncrypt') diff --git a/uncrypt/uncrypt.cpp b/uncrypt/uncrypt.cpp index 46da86d..2cf09a5 100644 --- a/uncrypt/uncrypt.cpp +++ b/uncrypt/uncrypt.cpp @@ -226,7 +226,7 @@ static int produce_block_map(const char* path, const char* map_file, const char* int wfd = -1; if (encrypted) { - wfd = open(blk_dev, O_WRONLY | O_SYNC); + wfd = open(blk_dev, O_WRONLY); if (wfd < 0) { ALOGE("failed to open fd for writing: %s\n", strerror(errno)); return -1; -- cgit v1.1