Re: [PATCH v2 5/9] iomap: introduce IOMAP_F_ZERO_TAIL flag
From: Namjae Jeon
Date: Mon May 11 2026 - 09:56:12 EST
On Mon, May 11, 2026 at 9:45 PM Christoph Hellwig <hch@xxxxxx> wrote:
>
> Note: out of subsystem patches should usually go first to stand out.
Okay.
>
> > @@ -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
Right. I agreed.
>
> * IOMAP_F_ZERO_TAIL indicates the remainder of the block after the
> * data written should be zeroed.
>
> ?
I will update it like this in the next version.
>
> 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?
Right.
Thanks for the review!
> And this does n