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

Christoph Hellwig <[email protected]> Tue, 7 Apr 2026 22:10:19 -0700
Newsgroups org.kernel.vger.target-devel,org.infradead.lists.linux-nvme,org.kernel.vger.linux-block,org.kernel.vger.linux-kernel,org.kernel.vger.linux-scsi
Message-ID <[email protected]>
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 <[email protected]> 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?