Re: [PATCH v2 5/9] iomap: introduce IOMAP_F_ZERO_TAIL flag
From: Christoph Hellwig
Date: Mon May 11 2026 - 08:50:38 EST
Note: out of subsystem patches should usually go first to stand out.
> @@ -853,6 +854,9 @@ static int __iomap_write_begin(const struct iomap_iter *iter,
> len, status, GFP_NOFS);
> if (status)
> return status;
> +
> + if (iomap->flags & IOMAP_F_ZERO_TAIL)
> + folio_zero_segment(folio, to, poff + plen);
> + * IOMAP_F_ZERO_TAIL indicates only the unwritten tail of the block should be
> + * zeroed.
So trying to understand what you are doing here.
We're writing to a block with the magic all invalid beyond this marker,
and you want the data beyond the file write zeroed. This seems really
nice and simply, but talking about 'unwritten' confused as I assumed it
to be an unwritten extent. But I guess this is not actually reported
as an unwritten extent, right? Maybe drop the unwritten here or
reword it as
* IOMAP_F_ZERO_TAIL indicates the remainder of the block after the
* data written should be zeroed.
?
And for all this to trigger that write needs to be at valid_size
but before i_size so that iomap_block_needs_zeroing does not kick in,
right?
And this does n