palo extended partition patch
RFC 1/1 palo extended partition patch
Hi all,
I was looking at palo and noticed the code to handle extended partitions beyond 2GB wasn't very elegant and maybe wrong.
But I don't have extended partitions on any of my systems. Anyone who does can build/test this for me?
I'm also wondering if the "Skipping extended partition" message should really be printed or not.
thanks
grant
Index: lib/diskpart.c
===================================================================
RCS file: /var/cvs/palo/lib/diskpart.c,v
retrieving revision 1.6
lib/diskpart.c +15 -3
@@ -53,12 +53,24 @@ load_partitions(int bootdev, struct diskwhile (extnum < maxparts) {/* we're currently using 32-bit file seeks which is ok since -* the IPL is also limited to 2G right now. So on big disks -* this next read may fail, and we need to let that happen -* gracefully. +* the IPL is also limited to 2G right now. On disks > 4GB +* this next read may fail. Handle that gracefully. +* Yes, we know newer IODC can read/write > 2GB but +* it would confuse too many people if the docs attempted +* to explain for no tangible benefit. And moving boot disks +* between systems will always work (assuming a useable +* kernel is present). */ +if (offset >= (2 *1024 *1024 *1024 /512 )) { +printf ("Skipping extended partition %d - beyond reach of IPL\n\r" , + extnum); +break ; + }if (seekread (bootdev, (char *)&fb,sizeof fb,512 * offset) ==-1 ) +printf ("seekread(bootdev,...,0x%x) failed!\n\r" , +512 * offset);break ; + }if (fb.dosmagic[0 ] !=0x55 || fb.dosmagic[1 ] !=0xaa ) {printf ("Bad DOS magic in extended partition\n\r" );