Re: [PATCH 1/3] block: add a bio_reuse helper

Darrick J. Wong
2026-01-10T00:50:10Z

On Fri, Jan 09, 2026 at 05:25:06PM +0100, Christoph Hellwig wrote:
> On Fri, Jan 09, 2026 at 08:19:06AM -0800, Darrick J. Wong wrote:
> > General question about bio_reset -- it calls bio_uninit, which strips
> > off the integrity and crypt metadata. I /think/ that will all get
> > re-added if necessary during the subsequent bio submission, right?
>
> Yes.
>
> > For your zonegc case, I wonder if it's actually a good idea to keep that
> > metadata attached as long as the bdev doesn't change across reuse?
>
> We need to generate different metadata for a different block location.
> Reusing the allocation might be useful, but it would really complicate
> this API, especially as the currently most common way to use integrity
> metadata is through the block layer auto PI, which allocates it below
> submit_bio and frees it before calling back into the submitter on I/O
> completion.
>
> But it might be worth writing up another sentence on this in the comment.

Yes, please. :)

With that brief mention that PI/crypt data get regenerated, I think I
understand what this (fairly brief refactoring) does, so
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D