On Wed, Feb 17, 2021 at 01:17:14PM -0500, Greg Troxel wrote: > > Last year, fdatasync() was changed to allow syncing files opened > > read-only, because that ceased to be prohibited by POSIX and something > > apparently depended on it. > > I have a dim memory of this and mongodb. > > > However, fsync_range() was not also so changed. Should it have been? > > It's now inconsistent with fsync and fdatasync and it seems like it's > > meant to be a strict superset of them. > > It seems like it might as well be. I would expect this to only really > sync the file's metadata, same as the others, but I do not feel like I > really understand this.
Well, if you have it open for write and I have it open for read, and I fsync it, it'll sync your changes. And report any errors to me, so if you're a database and I'm feeling nasty I can maybe mess with you that way. So I'm not sure it's a great idea. Right now fsync error reporting is a trainwreck though. -- David A. Holland dholl...@netbsd.org