Re: [PATCH] partitions/msdos.c

From: Uwe Bonnes
Date: Sat Feb 26 2005 - 18:27:04 EST


>>>>> "Linus" == Linus Torvalds <torvalds@xxxxxxxx> writes:

Linus> On Sat, 26 Feb 2005, Linus Torvalds wrote:
>> Would it not make more sense to just sanity-check the size itself,
>> and throw it out if the partition size (plus start) is bigger than
>> the disk size?

Linus> Something like this (TOTALLY UNTESTED AS USUAL!)?

Yes, no phantom partitions also with your approach.

Linus> What does fdisk and other tools do on that disk? Just out of
Linus> interest..

To be honest:
r50:~ # fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 65 MB, 65536000 bytes
17 heads, 33 sectors/track, 228 cylinders
Units = cylinders of 561 * 512 = 287232 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 229 63981+ 6 FAT16
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 1, 1) logical=(0, 1, 5)
Partition 1 has different physical/logical endings:
phys=(125, 16, 33) logical=(228, 2, 26)
/dev/sda4 3512348 6003585 698791990+ 0 Empty
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 0) logical=(3512347, 6, 16)
Partition 4 has different physical/logical endings:
phys=(0, 0, 0) logical=(6003584, 7, 6)
Partition 4 does not end on cylinder boundary.


--
Uwe Bonnes bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/