Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b84d879639f83d35d3fcd909222522c928bf974b
Commit:     b84d879639f83d35d3fcd909222522c928bf974b
Parent:     cce933bc831c451f48ca26e5b0d9bfdfbfb327f8
Author:     Mark Fortescue <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 25 18:30:08 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jul 30 00:27:28 2007 -0700

    [PARTITION] MSDOS: Fix Sun num_partitions handling.
    
    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]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 fs/partitions/msdos.c |    5 ++++-
 include/linux/genhd.h |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c
index 4ccec4c..5567ec0 100644
--- a/fs/partitions/msdos.c
+++ b/fs/partitions/msdos.c
@@ -203,6 +203,7 @@ parse_solaris_x86(struct parsed_partitions *state, struct 
block_device *bdev,
        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_partitions *state, struct 
block_device *bdev,
                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 --git a/include/linux/genhd.h b/include/linux/genhd.h
index 9756fc1..a47b802 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -264,7 +264,7 @@ static inline void set_capacity(struct gendisk *disk, 
sector_t size)
 
 #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 {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to