Re: patch-2.1.117 adds bad ide_xlate_1024()

Andries.Brouwer@cwi.nl
Sun, 23 Aug 1998 01:53:11 +0200 (MET DST)


From mlord@pobox.com Sat Aug 22 22:01:10 1998

Andries.Brouwer@cwi.nl wrote:
>
> In patch-2.1.117 there is the fragment

s/117/116/

> --- v2.1.115/linux/drivers/block/genhd.c Thu Aug 6 14:06:31 1998
> +++ linux/drivers/block/genhd.c Sun Aug 16 11:48:40 1998
...
> a very bad idea.
> It decides that all disks should use a translated geometry. Why?

The update was supposed to only affect LARGE drives that were
not otherwise accounted for by a translation scheme, an extremely
common case (any time a new drive is added to a system).

But the update was missing one line, that should fix most/all complaints
(update attached).
unsigned int heads = q->end_head + 1;
- if (heads == 32 || heads == 64 || heads == 128 || heads == 255) {
+ if (heads == 16 || heads == 32 || heads == 64 || heads == 128
+ || heads == 255) {

Hmm. This will diminish the number of complaining people somewhat
(maybe it will halve that number, but it will also cause grief to
people that were happy so far), but still you do not explain
*why* you want to use translation.

1. I think the original change was bad.
2. I think that this fix makes it worse.
3. I do not understand the purpose of these changes.

About 3.
You say that you want to do something for new drives, but you do
something for drives regardless of whether they are new or old.
It is rather annoying to have an already partitioned disk and have
its geometry changed so that all *fdisk's complain. And even have
some partitions extend beyond what the kernel now gives as the end
of the disk.
You say that you want to affect LARGE drives. But why is 1465/255/63
better than 23361/16/63 ? Because a larger fraction is below the 1024
cylinder limit?
I think it is very undesirable that 2.1.116 sees a geometry different
from the one 2.1.115 sees, certainly for already partitioned disks.

About 2.
The condition you add (`heads == 16') does not point at a translated
geometry - the disk may have 16 heads itself, so the new code is wrong,
I think. The spirit of the old code is: if it looks like a translated
geometry, then let us assume that that is what we have to tell fdisk and lilo.
A heuristic that will often work.
The new code (with `heads == 16') extends this heuristic to not necessarily
translated geometries, and I can see no reason why to test for 16 and not
for example for 15, which is also a number one finds very often.
It just means: believe the partition table.
But the partition table is information that *fdisk can read and write.
If you want to teach fdisk that it should believe what it finds on disk
no kernel change is necessary.
[But the contents of a partition table is rather weak evidence.
It is a bad idea to enlarge the number of cases in which this
heuristic is used.]

About 1.
Disk drive geometries is a very obscure subject. Only the Linux ide driver
already uses five different geometries for a disk, each of them a fiction
with very little relation to hardware facts.
There must be a very good reason for any change, otherwise the confusion
is only increased.

Andries

-
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.altern.org/andrebalsa/doc/lkml-faq.html