From: Martin K. Petersen Date: Tue, 4 Apr 2017 14:42:30 +0000 (-0400) Subject: scsi: sd: Fix capacity calculation with 32-bit sector_t X-Git-Tag: v3.2.91~25 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57ea1d3d9da0429c94cf3ccdaba2f8f9aee355cc;p=pandora-kernel.git scsi: sd: Fix capacity calculation with 32-bit sector_t commit 7c856152cb92f8eee2df29ef325a1b1f43161aff upstream. We previously made sure that the reported disk capacity was less than 0xffffffff blocks when the kernel was not compiled with large sector_t support (CONFIG_LBDAF). However, this check assumed that the capacity was reported in units of 512 bytes. Add a sanity check function to ensure that we only enable disks if the entire reported capacity can be expressed in terms of sector_t. Reported-by: Steve Magnani Cc: Bart Van Assche Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen [bwh: Backported to 3.2: use integer literal instead of U32_MAX] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed