|
|
Log in / Subscribe / Register

Other use cases

Other use cases

Posted Mar 4, 2026 19:06 UTC (Wed) by TheJH (subscriber, #101155)
In reply to: Other use cases by danielkza
Parent article: The ongoing quest for atomic buffered writes

though such a file manager could also, after finishing a copy operation, fsync() all the copied files, or if that's too much, syncfs() the entire filesystem, before indicating to the user that the operation has completed...


to post comments

Other use cases

Posted Mar 4, 2026 20:11 UTC (Wed) by farnz (subscriber, #17727) [Link]

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.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds