On Fri, Jun 28, 2024 at 09:46:21PM +0530, Kanchan Joshi wrote: > > static inline bool bio_integrity_endio(struct bio *bio) > > { > > - if (bio_integrity(bio)) > > + struct bio_integrity_payload *bip = bio_integrity(bio); > > + > > + if (bip && (bip->bip_flags & BIP_BLOCK_INTEGRITY)) > > return __bio_integrity_endio(bio); > > Seems we will need similar BIP_BLOCK_INTEGRITY check inside bio_uninit > too. At line 221 in below snippet [1]. > As that also frees integrity by calling bio_integrity_free. Earlier that > free was skipped due to BIP_INTEGRITY_USER flag. Now that flag has gone, > integrity will get freed and after that control may go back to > nvme-passthrough where it will try to unmap (and potentially copy back) > integrity. bio_integrity_free clears the REQ_INTEGRITY flag and the bi_integrity pointer, and bio_uninit checks for those using bio_integrity() first. The check is alredy required for the existing code and that doesn't change. > Seems this patch is with "for-6.11/block". > But with "for-next" you will see more places where this flag has been > used. And there will be conflicts because we have this patch there [1]. > Parts of this patch need changes to work with it. I can look more and > test next week. Oh, the patch actually does part of what this one does, _and_ I've reviewed it. Jens, maybe just skip the patch we are replying to (my one) for now, and I'll resend it for the next merge window as the conflicts vs the 6.10 tree would be too annoying.