]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sd: Reject optimal transfer length smaller than page size
authorMartin K. Petersen <martin.petersen@oracle.com>
Wed, 16 Dec 2015 22:53:52 +0000 (17:53 -0500)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 16 Jul 2016 06:41:58 +0000 (23:41 -0700)
commitaa2d687707d3fcdcf33f84a6925da747b7a51373
tree66b622aff0a9c86c5664a8dd9c4e48d65f8d03a0
parent7075419a056c3ee43f5f724fc4647769fb068045
sd: Reject optimal transfer length smaller than page size

Orabug: 23615929

(commit 9c1d9c207bb800498347a2716da298043ee280c5 of upstream)
Eryu Guan reported that loading scsi_debug would fail. This turned out
to be caused by scsi_debug reporting an optimal I/O size of 32KB which
is smaller than the 64KB page size on the PowerPC system in question.

Add a check to ensure that we only use the device-reported OPTIMAL
TRANSFER LENGTH if it is bigger than or equal to the page cache size.

Reported-by: Eryu Guan <guaneryu@gmail.com>
Reported-by: Ming Lei <tom.leiming@gmail.com>
Reviewed-by: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/scsi/sd.c