diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-06-25 04:58:58 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-06-26 17:33:10 -0400 |
commit | 8d55a786febd077f3a0db9f0672dfa1288b452af (patch) | |
tree | 8894c46d5d177eebec1474ac2426cdfc0561c1e7 /drivers/scsi | |
parent | 3e7196cf6070821ff8246b15dfd219ffa6409062 (diff) |
[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')
-rw-r--r-- | drivers/scsi/scsicam.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c index b78354fc4b17..cd68a66c7bb3 100644 --- a/drivers/scsi/scsicam.c +++ b/drivers/scsi/scsicam.c | |||
@@ -57,6 +57,7 @@ EXPORT_SYMBOL(scsi_bios_ptable); | |||
57 | int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) | 57 | int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) |
58 | { | 58 | { |
59 | unsigned char *p; | 59 | unsigned char *p; |
60 | u64 capacity64 = capacity; /* Suppress gcc warning */ | ||
60 | int ret; | 61 | int ret; |
61 | 62 | ||
62 | p = scsi_bios_ptable(bdev); | 63 | p = scsi_bios_ptable(bdev); |
@@ -68,7 +69,7 @@ int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) | |||
68 | (unsigned int *)ip + 0, (unsigned int *)ip + 1); | 69 | (unsigned int *)ip + 0, (unsigned int *)ip + 1); |
69 | kfree(p); | 70 | kfree(p); |
70 | 71 | ||
71 | if (ret == -1) { | 72 | if (ret == -1 && capacity64 < (1ULL << 32)) { |
72 | /* pick some standard mapping with at most 1024 cylinders, | 73 | /* pick some standard mapping with at most 1024 cylinders, |
73 | and at most 62 sectors per track - this works up to | 74 | and at most 62 sectors per track - this works up to |
74 | 7905 MB */ | 75 | 7905 MB */ |