lkml.org 
[lkml]   [2004]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectPATCH: 2.6.10 - Still mishandles volumes without geometry data
From
Date
An IDE device can choose not to report geometry. In this situation the
base 2.6 kernel tries to verify the LBA data despite having nothing to
validate it against and prints it out (although now only as pr_debug).

This patch fixes these problems and has in various forms been in
2.6.9-ac and Fedora Core for a considerable time now

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.10/drivers/ide/ide-disk.c linux-2.6.10/drivers/ide/ide-disk.c
--- linux.vanilla-2.6.10/drivers/ide/ide-disk.c 2004-12-25 21:15:34.000000000 +0000
+++ linux-2.6.10/drivers/ide/ide-disk.c 2004-12-26 21:55:43.084714368 +0000
@@ -84,6 +84,10 @@
{
unsigned long lba_sects, chs_sects, head, tail;

+ /* No non-LBA info .. so valid! */
+ if (id->cyls == 0)
+ return 1;
+
/*
* The ATA spec tells large drives to return
* C/H/S = 16383/16/63 independent of their size.
@@ -201,7 +205,8 @@
head = track % drive->head;
cyl = track / drive->head;

- pr_debug("%s: CHS=%u/%u/%u\n", drive->name, cyl, head, sect);
+ if(drive->bios_cyl)
+ pr_debug("%s: CHS=%u/%u/%u\n", drive->name, cyl, head, sect);

hwif->OUTB(0x00, IDE_FEATURE_REG);
hwif->OUTB(nsectors.b.low, IDE_NSECTOR_REG);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.049 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site