#7251 f.flush() or os.fsync() don't sync
Closed: fixed Opened by cheimes.

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.

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.


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:

  • b274da726b896730b47d47f4ad664c5c0583b469 Replace file.flush() calls with flush_sync() helper

Metadata Update from @cheimes:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata