On Mon, Sep 02, 2019 at 06:31:24PM +0200, Christoph Hellwig wrote: > On Sun, Sep 01, 2019 at 03:08:24PM -0500, Goldwyn Rodrigues wrote: > > > + iomap_assert(!(iomap->flags & IOMAP_F_BUFFER_HEAD)); > > + iomap_assert(srcmap->type == IOMAP_HOLE || srcmap->addr > 0); > > 0 can be a valid address in various file systems, so I don't think we > can just exclude it. Then again COWing from a hole seems pointless, > doesn't it? XFS does that if you set a cowextsize hint and a speculative cow preallocation ends up covering a hole. Granted I don't think there's much point in reading from a COW fork extent to fill in an unaligned buffered write since it /should/ just end up zero-filling the pagecache regardless of fork... but I don't see much harm in doing that. --D > So just check for addr != IOMAP_NULL_ADDR here? > > > > > @@ -961,7 +966,7 @@ iomap_zero_range_actor(struct inode *inode, loff_t pos, loff_t count, > > if (IS_DAX(inode)) > > status = iomap_dax_zero(pos, offset, bytes, iomap); > > else > > - status = iomap_zero(inode, pos, offset, bytes, iomap); > > + status = iomap_zero(inode, pos, offset, bytes, iomap, srcmap); > > This introduces an > 80 character line.