• Martin K. Petersen's avatar
    sd: Limit transfer length · bcdb247c
    Martin K. Petersen authored
    Until now the per-command transfer length has exclusively been gated by
    the max_sectors parameter in the scsi_host template. Given that the size
    of this parameter has been bumped to an unsigned int we have to be
    careful not to exceed the target device's capabilities.
    
    If the if the device specifies a Maximum Transfer Length in the Block
    Limits VPD we'll use that value. Otherwise we'll use 0xffffffff for
    devices that have use_16_for_rw set and 0xffff for the rest. We then
    combine the chosen disk limit with max_sectors in the host template. The
    smaller of the two will be used to set the max_hw_sectors queue limit.
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    Reviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    bcdb247c
sd.h 4.9 KB