On Wed, 29 Nov 2023 at 08:25, Amir Goldstein <amir73il@xxxxxxxxx> wrote: > My proposed solution is to change the semantics with the init flag > FUSE_PASSTHROUGH to disallow mmap on FOPEN_DIRECT_IO > files. Why? FOPEN_DIRECT_IO and FUSE_PASSTHROUGH should mix much more readily than FOPEN_DIRECT_IO with page cache. > So with a filesystem that supports FUSE_PASSTHROUGH, > FOPEN_DIRECT_IO files can only be used for direct read/write io and > mmap maps either the fuse inode pages or the backing inode pages. > > This also means that FUSE_DIRECT_IO_RELAX conflicts with > FUSE_PASSTHROUGH. > > Should we also deny mixing FUSE_HAS_INODE_DAX with > FUSE_PASSTHROUGH? Anything else from virtiofs? Virtiofs/DAX and passthrough are similar features in totally different environments. We just need to make sure the code paths don't collide. > While I have your attention, I am trying to consolidate the validation > of FOPEN_ mode vs inode state into fuse_finish_open(). > > What do you think about this partial patch that also moves > fuse_finish_open() to after fuse_release_nowrite(). > Is it legit? I suspect it won't work due to the i_size reset being in fuse_finish_open(). But I feel there's not enough context to understand why this is needed. Thanks, Miklos