[parisc-linux] [RFC] palo extended partition patch

Grant Grundler grundler at parisc-linux.org
Tue May 4 16:56:34 MDT 2004


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
diff -u -p -r1.6 diskpart.c
--- a/lib/diskpart.c	4 May 2004 21:41:05 -0000	1.6
+++ b/lib/diskpart.c	4 May 2004 22:01:25 -0000
@@ -53,12 +53,24 @@ load_partitions(int bootdev, struct disk
 	while (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");


More information about the parisc-linux mailing list