On Tue, Oct 08, 2019 at 05:12:38PM +0200, Jan Kara wrote: > Seeing how difficult it is when a filesystem wants to complete the iocb > synchronously (regardless whether it is async or sync) and have all the > information in one place for further processing, I think it would be the > easiest to provide iomap_dio_rw_wait() that forces waiting for the iocb to > complete *and* returns the appropriate return value instead of pretty > useless EIOCBQUEUED. It is actually pretty trivial (patch attached). With > this we can then just call iomap_dio_rw_sync() for the inode extension case > with ->end_io doing just the unwritten extent processing and then call > ext4_handle_inode_extension() from ext4_direct_write_iter() where we would > have all the information we need. > > Christoph, Darrick, what do you think about extending iomap like in the > attached patch (plus sample use in XFS)? I vaguely remember suggesting something like this but Brian or Dave convinced me it wasn't a good idea. This will require a trip to the xfs or fsdevel archives from when the inode_dio_wait was added in XFS. But if we decide it actully works this time around please don't add the __ variant but just add the parameter to iomap_dio_rw directly.