On Fri, 9 Feb 2024 at 11:35, Amir Goldstein <amir73il@xxxxxxxxx> wrote: > No reason apart from "symmetry" with the other io mode FOPEN flags. > I will use an internal flag. Okay. Other ff->open_flags are set at open time and never changed. FOPEN_CACHE_IO doesn't fit into that pattern. > I added io_open to fix a bug in an earlier version where fuse_file_release() > was called on the error path after fuse_file_io_open() failed. > > The simple change would be to replace FOPEN_CACHE_IO flag > with ff->io_cache_opened bit. Right. > > I assume you meant to change ff->io_opened to an enum: > { FUSE_IO_NONE, FUSE_IO_CACHE, FUSE_IO_DIRECT, > FUSE_IO_PASSTHROUGH } > > Is that what you mean? I just meant ff->io_cache_opened is only set when the cache counter needs decrementing. The logic is simpler and is trivially right. Thanks, Miklos