On Tue, Mar 05, 2024 at 05:49:33PM +0000, Daniel P. Berrangé wrote: > I don't think you should be removing this. Calling qio_channel_close() > remains recommended best practice, even with fdatasync() removed, as > it provides a strong guarantee that the FD is released which you don't > get if you rely on the ref count being correctly decremented in all > code paths.
Hmm, I have the confusion on why ioc->fd is more special than the ioc itself when leaked. It'll be a bug anyway if we leak any of them? Leaking fds may also help us to find such issue easier (e.g. by seeing stale fds under /proc). From that POV I tend to agree on the original proposal. Now we removed the data sync, IIUC it means the mgmt can always flush the cache with/without the fd closed in QEMU even if it's leaked. So I don't yet see other side effects of leaking the fd which will cause a difference comparing to leaking the ioc? Thanks, -- Peter Xu