A couple of places use f.flush(), os.fsync(f.fileno()) or os.fdatasync(f.fileno()) sync to flush file content to disk. However that is not enough. f.flush() only flushes file buffer to file descriptor. os.fsync(f.fileno()) needs to be accompanied by f.flush(). For new files, it does not sync the directory inode to disk.
f.flush()
os.fsync(f.fileno())
os.fdatasync(f.fileno())
PR 1257 introduces ipautil.flush_sync(f), which does all magic in correct order. All calls to flush and fsync should be replaced with the helper method.
ipautil.flush_sync(f)
ACK!
Metadata Update from @frenaud: - Issue set to the milestone: FreeIPA 4.7
Metadata Update from @pvoborni: - Issue priority set to: normal - Issue tagged with: robustness
Metadata Update from @abiagion: - Issue assigned to abiagion
master:
Metadata Update from @cheimes: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
Login to comment on this ticket.