On Wed, 01/20 11:01, Martin K. Petersen wrote: > Commit ca369d51b3e1 ("block/sd: Fix device-imposed transfer length > limits") accidentally switched optimal I/O size reporting from bytes to > block layer sectors. > > Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> > Reported-by: Christian Borntraeger <borntraeger@xxxxxxxxxx> > --- > drivers/scsi/sd.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c > index 4e08d1cd704d..ec163d08f6c3 100644 > --- a/drivers/scsi/sd.c > +++ b/drivers/scsi/sd.c > @@ -2893,7 +2893,7 @@ static int sd_revalidate_disk(struct gendisk *disk) > sdkp->opt_xfer_blocks <= SD_DEF_XFER_BLOCKS && > sdkp->opt_xfer_blocks * sdp->sector_size >= PAGE_CACHE_SIZE) > rw_max = q->limits.io_opt = > - logical_to_sectors(sdp, sdkp->opt_xfer_blocks); > + sdkp->opt_xfer_blocks * sdp->sector_size; Hi Martin, This looks wrong to me, maybe I'm missing the obvious? Here sdkp->opt_xfer_blocks is in block size unit, and rw_max is in byte unit. Following is: else rw_max = BLK_DEF_MAX_SECTORS; Which seems in sector unit, and is already making above change suspicious, and further down: /* Combine with controller limits */ q->limits.max_sectors = min(rw_max, queue_max_hw_sectors(q)); looks like a unit mismatch to me. IIUC q->limits.max_sectors _is_ in sector unit, similar to queue_max_hw_sectors(). Is the error reported by Christian fixed just because we are setting an incorrect high max? (I noticed this when I see I/O error because a virtio-scsi guest starts to issue large reads that are rejected by host device.) Fam -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html