Re: Bug reintroduced in genhd.c

Matthew D. Pitts (mpitts@suite224.net)
Wed, 23 Sep 1998 15:19:44 -0400


----------
> From: Andries.Brouwer@cwi.nl
> To: linux-kernel@vger.rutgers.edu; torvalds@transmeta.com
> Subject: Bug reintroduced in genhd.c
> Date: Tuesday, September 22, 1998 6:58 PM
>
> In 2.1.122 I find
>
> - if (heads == 32 || heads == 64 ||
> - heads == 128 || heads == 255
||
> - heads == 240) {
> + if (heads == 15 || heads == 16 ||
> + heads == 32 || heads == 64 ||
> + heads == 128 || heads == 240
||
> + heads == 255) {
> (void)
ide_xlate_1024(dev, heads
> , " [PTBL]");
>
>
> This was a bug we discussed last month or so on the list,
> and corrected. Don't know why somebody decided to reintroduce it.
>
> Doing an ide_xlate_1024 is in principle a very bad idea -
> something to be done in emergency cases only.
> This translation business is a mess, not something to
> do without a very good reason.
>
> The old code said: heads > 16 - this cannot be an original
> geometry, it must be a translation. It caused trouble, but
> not too much, a reasonable assumption.
>
> However, 15 or 16 heads is quite normal - there is no reason
> at all to assume that some translation is active.
> This heuristic of looking at the partition table to guess
> what the right geometry might be is a very insecure one.
> Not all Linux fdisks end partitions on cylinder boundaries
> so for many systems this patch will cause trouble. Moreover,
> people that have hosed their partition table will now
> suddenly find that the kernel uses some strange geometry
> to access the disk, and have great problems repairing the
> situation with fdisk, because also fdisk will get this silly
> geometry from the kernel.
> Moreover, this change throws away some disk blocks because
> of rounding that occurs, making part of perfectly good
> partitions inaccessible.
>
> Please revert this change.
Given the fact that UDMA on some motherboard/IDE-HD combos is hosed (aka
doesn't work), maybe it was put back in so that they would be usable. Just
a thought.

Matthew D. Pitts
N8OHU
mpitts@suite224.net
http://www.suite224.net/~mpitts/
Ain't gonna let no rock out-praise me
Luke 19:40

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/