Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc4e3c60 authored by Jaegeuk Kim's avatar Jaegeuk Kim
Browse files

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: default avatarJaegeuk Kim <jaegeuk@motorola.com>
parent 4ea2b0c4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ static int produce_block_map(const char* path, const char* map_file, const char*
    int wfd = -1;
    unique_fd wfd_holder(wfd);
    if (encrypted) {
        wfd = open(blk_dev, O_WRONLY | O_SYNC);
        wfd = open(blk_dev, O_WRONLY);
        wfd_holder = unique_fd(wfd);
        if (wfd == -1) {
            ALOGE("failed to open fd for writing: %s\n", strerror(errno));