On Thu, May 26, 2022 at 10:41:31PM -0700, Christoph Hellwig wrote: > I suspect this might be where your problems lies: > > blockdev_direct_IO calls __blockdev_direct_IO with DIO_SKIP_HOLES set. > DIO_SKIP_HOLES causes get_more_blocks to never set the create bit > to get_block except for writes beyond i_size. If we want to replicate > that behavior with iomap, ->iomap_begin needs to return -ENOTBLK > when it encounters a hole for writing. To properly supporting writing > to holes we'd need unwritten extents, which jfs does not support. > gfs2 might be a place to look for how to implement this. I think JFS does support unwritten extents, fs/jfs/jfs_xtree.h:#define XAD_NOTRECORDED 0x08 /* allocated but not recorded */ However, we always pass 'false' to extAlloc() today, so I think it hasn't been tested in a while? I'm not sure I want to be the one to start using new features on JFS for something that's supposed to be a relatively quick cleanup.