#7251 f.flush() or os.fsync() don't sync
Closed: fixed 5 years ago Opened 6 years ago 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

6 years ago

Metadata Update from @pvoborni:
- Issue priority set to: normal
- Issue tagged with: robustness

6 years ago

Metadata Update from @abiagion:
- Issue assigned to abiagion

5 years ago

master:

  • b274da7 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)

5 years ago

Login to comment on this ticket.

Metadata