Re: [PATCH 2/6] block: use integrity interval instead of sector as seed

Christoph Hellwig
2026-04-08T05:10:22Z

On Tue, Apr 07, 2026 at 09:48:52AM -0700, Caleb Sander Mateos wrote:
> On Sun, Apr 5, 2026 at 11:35 PM Christoph Hellwig <hch@infradead.org> wrote:
> >
> > On Fri, Apr 03, 2026 at 01:41:05PM -0600, Caleb Sander Mateos wrote:
> > > void bio_integrity_setup_default(struct bio *bio)
> > > {
> > > struct blk_integrity *bi = blk_get_integrity(bio->bi_bdev->bd_disk);
> > > struct bio_integrity_payload *bip = bio_integrity(bio);
> > >
> > > - bip_set_seed(bip, bio->bi_iter.bi_sector);
> > > + bip_set_seed(bip, bio_integrity_intervals(bi, bio->bi_iter.bi_sector));
> >
> > Should we simply switch bip_set_seed to take a bio bvec_iter argument and
> > lift all this logic into it? That feels a lot less fragile.
>
> Perhaps I'm misunderstanding the suggestion, but how would that work
> for initializing the seed from struct uio_meta in
> bio_integrity_map_iter()?
>
> bip_set_seed(bio_integrity(bio), meta->seed);

Just open code the assignment there as the code must be build with
blk-integrityu support?