Message ID | 0bc2e9a09870610a48e0033a0370941ad549ba6b.1471002480.git.tom.ty89@gmail.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers | show |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index d3e852a..2b6da13 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -2875,8 +2875,11 @@ static int sd_revalidate_disk(struct gendisk *disk) logical_to_bytes(sdp, sdkp->opt_xfer_blocks) >= PAGE_SIZE) { q->limits.io_opt = logical_to_bytes(sdp, sdkp->opt_xfer_blocks); rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks); - } else + } else { rw_max = BLK_DEF_MAX_SECTORS; + /* Combine with device limits */ + rw_max = min(rw_max, q->limits.max_dev_sectors); + } /* Combine with controller limits */ q->limits.max_sectors = min(rw_max, queue_max_hw_sectors(q));