Skip to content

Commit

Permalink
Merge remote-tracking branch 'mkp-scsi/4.4/scsi-fixes' into fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
James Bottomley authored and James Bottomley committed Dec 28, 2015
2 parents ed94724 + 9c1d9c2 commit f9ec0d5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2885,10 +2885,13 @@ static int sd_revalidate_disk(struct gendisk *disk)

/*
* Use the device's preferred I/O size for reads and writes
* unless the reported value is unreasonably large (or garbage).
* unless the reported value is unreasonably small, large, or
* garbage.
*/
if (sdkp->opt_xfer_blocks && sdkp->opt_xfer_blocks <= dev_max &&
sdkp->opt_xfer_blocks <= SD_DEF_XFER_BLOCKS)
if (sdkp->opt_xfer_blocks &&
sdkp->opt_xfer_blocks <= dev_max &&
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);
else
Expand Down

0 comments on commit f9ec0d5

Please sign in to comment.