mirror of
https://github.com/Evolution-X-Devices/device_xiaomi_stone
synced 2026-01-27 17:18:49 +00:00
sm6375-common: gpt-utils: Do fsync after writing partition entries
Do fsync after writing partition entries to ensure data is actually written before rebooting device. Change-Id: Ia2067d5e215b60290165b0dfd4ba842434343058
This commit is contained in:
@@ -1374,7 +1374,7 @@ int gpt_disk_get_disk_info(const char *dev, struct gpt_disk *dsk)
|
||||
dev);
|
||||
goto error;
|
||||
}
|
||||
fd = open(disk->devpath, O_RDWR);
|
||||
fd = open(disk->devpath, O_RDWR | O_DSYNC);
|
||||
if (fd < 0) {
|
||||
ALOGE("%s: Failed to open %s: %s",
|
||||
__func__,
|
||||
@@ -1510,6 +1510,7 @@ int gpt_disk_commit(struct gpt_disk *disk)
|
||||
__func__);
|
||||
goto error;
|
||||
}
|
||||
fsync(fd);
|
||||
close(fd);
|
||||
return 0;
|
||||
error:
|
||||
|
||||
Reference in New Issue
Block a user