Other use cases
Other use cases
Posted Mar 4, 2026 20:11 UTC (Wed) by farnz (subscriber, #17727)In reply to: Other use cases by TheJH
Parent article: The ongoing quest for atomic buffered writes
Ideally, though, the file manager wants to report progress to the user - which means that you want notifications for fsync progress, not just write progress. That pushes you in the direction of sync_file_range, too - you'd end up submitting a series of sync_file_range(fd, offset, len, SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_AFTER) operations to get you progress, then an fsync to sync the file metadata, then either a syncfs or a set of fsyncs on directories to ensure that the file is safely on disk.
