]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[SCSI] Bogus disk geometry on large disks
authorAlan Cox <alan@lxorguk.ukuu.org.uk>
Sun, 25 Jun 2006 08:58:58 +0000 (01:58 -0700)
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>
Mon, 26 Jun 2006 21:33:10 +0000 (16:33 -0500)
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>
drivers/scsi/scsicam.c

index b78354fc4b1715fe0ffc08c3500a9937075e245f..cd68a66c7bb3cef1d297d9fde33eadcfef967630 100644 (file)
@@ -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 */