summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsicam.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-06-25 01:58:58 -0700
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-26 16:33:10 -0500
commit8d55a786febd077f3a0db9f0672dfa1288b452af (patch)
tree8894c46d5d177eebec1474ac2426cdfc0561c1e7 /drivers/scsi/scsicam.c
parent3e7196cf6070821ff8246b15dfd219ffa6409062 (diff)
downloadop-kernel-dev-8d55a786febd077f3a0db9f0672dfa1288b452af.zip
op-kernel-dev-8d55a786febd077f3a0db9f0672dfa1288b452af.tar.gz
[SCSI] Bogus disk geometry on large disks
We currently stuff a truncated size into the geometry logic and return the result which can produce bizarre reports for a 4Tb array. Since that mapping logic isn't useful for disks that big don't try and map this way at all. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsicam.c')
-rw-r--r--drivers/scsi/scsicam.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
index b78354f..cd68a66 100644
--- a/drivers/scsi/scsicam.c
+++ b/drivers/scsi/scsicam.c
@@ -57,6 +57,7 @@ EXPORT_SYMBOL(scsi_bios_ptable);
int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip)
{
unsigned char *p;
+ u64 capacity64 = capacity; /* Suppress gcc warning */
int ret;
p = scsi_bios_ptable(bdev);
@@ -68,7 +69,7 @@ int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip)
(unsigned int *)ip + 0, (unsigned int *)ip + 1);
kfree(p);
- if (ret == -1) {
+ if (ret == -1 && capacity64 < (1ULL << 32)) {
/* pick some standard mapping with at most 1024 cylinders,
and at most 62 sectors per track - this works up to
7905 MB */
OpenPOWER on IntegriCloud