On Mon, Jan 13, 2025 at 11:04:51PM +0800, Ming Lei wrote: > > instances, and we need to fsync with a frozen queue to ensure there > > is no outstanding I/O. > > loop_configure() is on unbound loop, so there isn't outstanding I/O. Yeah. > loop_change_fd() is switching to this new file, so no outstanding I/O > on this new file before unfreeze. True. > The other two can only switch to buffered IO, which needn't the fsync. > > So can you point out anything is wrong? > > And this way is sort of simplification. Yeah, I think this is fine in this version. But please update the comment away from the avoiding races to spell out that this is writing out the page cache before starting to use direct I/O.