Merge "snapshotctl: fsync after writing every 1MB buffer" into main
This commit is contained in:
commit
37e7498fc0
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue