Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Alan Cox and committed by
James Bottomley
8d55a786 3e7196cf

+2 -1
+2 -1
drivers/scsi/scsicam.c
··· 57 57 int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) 58 58 { 59 59 unsigned char *p; 60 + u64 capacity64 = capacity; /* Suppress gcc warning */ 60 61 int ret; 61 62 62 63 p = scsi_bios_ptable(bdev); ··· 69 68 (unsigned int *)ip + 0, (unsigned int *)ip + 1); 70 69 kfree(p); 71 70 72 - if (ret == -1) { 71 + if (ret == -1 && capacity64 < (1ULL << 32)) { 73 72 /* pick some standard mapping with at most 1024 cylinders, 74 73 and at most 62 sectors per track - this works up to 75 74 7905 MB */