On Fri, May 10, 2024 at 03:14:29PM +0530, Anuj Gupta wrote: > The user mapped intergity is copied back and unpinned by > bio_integrity_free which is a low-level routine. Do it via the submitter > rather than doing it in the low-level block layer code, to split the > submitter side from the consumer side of the bio. Thanks, this looks pretty good. > out_unmap: > - if (bio) > + if (bio) { > + if (bio_integrity(bio)) > + bio_integrity_unmap_free_user(bio); > blk_rq_unmap_user(bio); > + } Since we're adding more cleanup responsibilities on the caller, and this pattern is repeated 4 times, I think a little helper function is warranted: 'nvme_unmap_bio(struct bio *bio)', or something like that.