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

Commit 37e7498f authored by Akilesh Kailash's avatar Akilesh Kailash Committed by Gerrit Code Review
Browse files

Merge "snapshotctl: fsync after writing every 1MB buffer" into main

parents 54702a79 b78d0e28
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -227,8 +227,12 @@ bool MapSnapshots::WriteSnapshotPatch(std::string cow_device, std::string patch)
        if (file_offset >= dev_sz) {
            break;
        }

        if (fsync(cfd.get()) < 0) {
            PLOG(ERROR) << "Fsync failed at offset: " << file_offset << " size: " << to_read;
            return false;
        }
    }
    fsync(cfd.get());
    return true;
}