And third time lucky - forgot to remove the white space.

On Wed, 25 Jul 2007, David Miller wrote:

From: Mark Fortescue <[EMAIL PROTECTED]>
Date: Thu, 26 Jul 2007 01:15:51 +0100 (BST)

OK This one is easy as the VTOC structure is only used in
fs/partions/msdos.c and the parts that get moved by changing the number
of slices are not used yet (v2.6.22). I have attached a patch.

Doesn't apply to 2.6.23-rc1, can you rediff for me and kill
the trailing whitespace on the line with the comment you
added?

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
From: Mark Fortescue <[EMAIL PROTECTED]>

Correct the Solaris x86 number of partitions (slices) is a way that is
backward compatible with the earlier size.
This works without a new VTOC structure definition as the timestamp
and v_asciilabel fields in the VTOC are not used by the kernel yet.

Signed-off-by: Mark Fortescue <[EMAIL PROTECTED]>
---
diff -ruNpd -x .git -x .gitignore -x .mailmap linux-2.6/fs/partitions/msdos.c 
linux-test/fs/partitions/msdos.c
--- linux-2.6/fs/partitions/msdos.c     2007-07-24 22:47:22.000000000 +0100
+++ linux-test/fs/partitions/msdos.c    2007-07-26 00:40:41.000000000 +0100
@@ -203,6 +203,7 @@ parse_solaris_x86(struct parsed_partitio
        Sector sect;
        struct solaris_x86_vtoc *v;
        int i;
+       short max_nparts;
 
        v = (struct solaris_x86_vtoc *)read_dev_sector(bdev, offset+1, &sect);
        if (!v)
@@ -218,7 +219,9 @@ parse_solaris_x86(struct parsed_partitio
                put_dev_sector(sect);
                return;
        }
-       for (i=0; i<SOLARIS_X86_NUMSLICE && state->next<state->limit; i++) {
+       /* Ensure we can handle previous case of VTOC with 8 entries gracefully 
*/
+       max_nparts = le16_to_cpu (v->v_nparts) > 8 ? SOLARIS_X86_NUMSLICE : 8;
+       for (i=0; i<max_nparts && state->next<state->limit; i++) {
                struct solaris_x86_slice *s = &v->v_slice[i];
                if (s->s_size == 0)
                        continue;
diff -ruNpd -x .git -x .gitignore -x .mailmap linux-2.6/include/linux/genhd.h 
linux-test/include/linux/genhd.h
--- linux-2.6/include/linux/genhd.h     2007-07-24 22:47:26.000000000 +0100
+++ linux-test/include/linux/genhd.h    2007-07-26 00:38:30.000000000 +0100
@@ -264,7 +264,7 @@ static inline void set_capacity(struct g
 
 #ifdef CONFIG_SOLARIS_X86_PARTITION
 
-#define SOLARIS_X86_NUMSLICE   8
+#define SOLARIS_X86_NUMSLICE   16
 #define SOLARIS_X86_VTOC_SANE  (0x600DDEEEUL)
 
 struct solaris_x86_slice {

Reply via email to