Message ID | 20240904152605.4055570-4-kbusch@meta.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | block integrity merging and counting | expand |
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c > index 3958a6d14bf45..dc1a1644cbc0c 100644 > --- a/drivers/scsi/scsi_lib.c > +++ b/drivers/scsi/scsi_lib.c > @@ -1175,8 +1175,7 @@ blk_status_t scsi_alloc_sgtables(struct scsi_cmnd *cmd) > goto out_free_sgtables; > } > > - ivecs = blk_rq_count_integrity_sg(rq->q, rq->bio); > - > + ivecs = blk_rq_integrity_segments(rq); Looks good: Reviewed-by: Christoph Hellwig <hch@lst.de> although I'd be tempted to just remove the BUG_ON below (or move it into blk_rq_map_integrity_sg) and the ivecs variable entirely.
On Tue, Sep 10, 2024 at 05:32:17PM +0200, Christoph Hellwig wrote: > > although I'd be tempted to just remove the BUG_ON below (or move > it into blk_rq_map_integrity_sg) and the ivecs variable entirely. Right, I actually have more follow up's doing that. We just need to change blk_rq_map_integrity_sg() first to take a request instead of a request_queue + bio. I thought I might be getting carried away with the "cleanups" though, so was saving that for later. I can definitely add that into the series now though.
On Tue, Sep 10, 2024 at 05:02:18PM -0600, Keith Busch wrote: > Right, I actually have more follow up's doing that. We just need to > change blk_rq_map_integrity_sg() first to take a request instead of a > request_queue + bio. I thought I might be getting carried away with the > "cleanups" though, so was saving that for later. I can definitely add > that into the series now though. Well, it seems like the metadata code really needs a lot more attention :( And it seems like we really need the io_uring passthrough support to be able to fully exercise it.
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 3958a6d14bf45..dc1a1644cbc0c 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1175,8 +1175,7 @@ blk_status_t scsi_alloc_sgtables(struct scsi_cmnd *cmd) goto out_free_sgtables; } - ivecs = blk_rq_count_integrity_sg(rq->q, rq->bio); - + ivecs = blk_rq_integrity_segments(rq); if (sg_alloc_table_chained(&prot_sdb->table, ivecs, prot_sdb->table.sgl, SCSI_INLINE_PROT_SG_CNT)) {