Skip to contentSkip to conversation

2.6.0-test1 on alpha : disk label numbering trouble

PATCH In review [email protected] 3 participants 5 messages Jul 28, 2003 – Jul 29, 2003

lore
Share & tools
lore
#0 lore raw

From: "Ghozlane Toumi" <[email protected]>

> > I'm trying to run 2.6.0-test1 on an alpha box, > > and apparently, the osf partition numbering is wrong:

2.4:
sda: sda3 sda4 sda5

2.6:
sda: sda1 sda2 sda3

OK, I see what happened - viro changed things a little, maybe by mistake.

I suppose the below will give you your original numbering again. (Please confirm.)

Andries

osf.c renamed from osf.c~ +2 -1
@@ -67,9 +67,10 @@
 		if (slot == state->limit)
 		        break;
 		if (le32_to_cpu(partition->p_size))
-			put_partition(state, slot++,
+			put_partition(state, slot,
 				le32_to_cpu(partition->p_offset),
 				le32_to_cpu(partition->p_size));
+		slot++;
 	}
 	printk("\n");
 	put_dev_sector(sect);
#1 lore raw

From: <[email protected]>

Quoted 11 lines

2.4:
sda: sda3 sda4 sda5

2.6:
sda: sda1 sda2 sda3

OK, I see what happened - viro changed things a little, maybe by mistake.

I suppose the below will give you your original numbering again. (Please confirm.)

yes, it works , thanks.
quickly checking viro's changes in this area, it seems other partitions schemes are touched by the same problem...

Quoted 4 lines
osf.c Mon Jul 28 16:13:03 2003 renamed from osf.c~ Wed Mar 5 04:29:32 2003 +0 -0
@@ -67,9 +67,10 @@
  if (slot == state->limit)

osf.c Mon Jul 28 16:13:03 2003 line 76

Quoted 10 lines
osf.c Mon Jul 28 16:13:03 2003 renamed from osf.c~ Wed Mar 5 04:29:32 2003 +2 -1
          break;
  if (le32_to_cpu(partition->p_size))
- put_partition(state, slot++,
+ put_partition(state, slot,
  le32_to_cpu(partition->p_offset),
  le32_to_cpu(partition->p_size));
+ slot++;
  }
  printk("\n");
  put_dev_sector(sect);

thanks,

ghoz

#2 lore raw

PATCH 1/1 sgi partitionning fix (Was: 2.6.0-test1 on alpha : disk label numbering trouble)

Quoted 2 lines

quickly checking viro's changes in this area, it seems other partitions schemes are touched by the same problem...

I stand corrected. after looking a little bit deeper, the sun partition has been corrected, the other are not touched.
However, I found out that sgi partitionning had this "renumbering" issue even before viro's patch.
I don't know if this is correct, in any case this is an untested patch that changes this behaviour for sgi partitions.
patch is attached because of dumb mailer.

thanks,
ghoz

fs/partitions/sgi.c +1 -2
diff -Nr -U4 -X dontdiff linux-2.6.0-test1.orig/fs/partitions/sgi.c linux-2.6.0-test1/fs/partitions/sgi.c
@@ -29,9 +29,8 @@
 
 int sgi_partition(struct parsed_partitions *state, struct block_device *bdev)
 {
 	int i, csum, magic;
-	int slot = 1;
 	unsigned int *ui, start, blocks, cs;
 	Sector sect;
 	struct sgi_disklabel *label;
 	struct sgi_partition *p;
@@ -67,9 +66,9 @@
 	for(i = 0; i < 16; i++, p++) {
 		blocks = be32_to_cpu(p->num_blocks);
 		start  = be32_to_cpu(p->first_block);
 		if (blocks)
-			put_partition(state, slot++, start, blocks);
+			put_partition(state, i+1, start, blocks);
 	}
 	printk("\n");
 	put_dev_sector(sect);
 	return 1;
#3 lore raw

Re: [PATCH] sgi partitionning fix (Was: 2.6.0-test1 on alpha : disk label numbering trouble)

Quoted 10 lines · Ghozlane Toumi

However, I found out that sgi partitionning had this "renumbering" issue even before viro's patch.
I don't know if this is correct, in any case this is an untested patch that changes this behaviour for sgi partitions.
patch is attached because of dumb mailer.
--------------------

        for(i = 0; i < 16; i++, p++) {
                blocks = be32_to_cpu(p->num_blocks);
                start  = be32_to_cpu(p->first_block);
                if (blocks)

fs/partitions/sgi.c

Quoted 4 lines
fs/partitions/sgi.c +1 -2
-                       put_partition(state, slot++, start, blocks);
+                       put_partition(state, i+1, start, blocks);
        }
--------------------

Hmm. The previous change was not because there is something intrinsically good with some way of numbering partitions, but because it is very inconvenient when partition numbering changes.

Thus, the previous patch made OSF in 2.6 do as it did in 2.4.

But here the 2.6 behaviour is already that of 2.4.21, and you change away from that. Not a good idea.

Andries

#4 lore raw

Re: [PATCH] sgi partitionning fix (Was: 2.6.0-test1 on alpha : disk label numbering trouble)

Quoted 17 lines · You
Quoted 10 lines · Ghozlane Toumi

However, I found out that sgi partitionning had this "renumbering" issue even before viro's patch.
I don't know if this is correct, in any case this is an untested patch that changes this behaviour for sgi partitions.
patch is attached because of dumb mailer.
--------------------

        for(i = 0; i < 16; i++, p++) {
                blocks = be32_to_cpu(p->num_blocks);
                start  = be32_to_cpu(p->first_block);
                if (blocks)

fs/partitions/sgi.c

Quoted 4 lines
fs/partitions/sgi.c +1 -2
-                       put_partition(state, slot++, start, blocks);
+                       put_partition(state, i+1, start, blocks);
        }
--------------------
Quoted 4 lines

Hmm. The previous change was not because there is something intrinsically good with some way of numbering partitions, but because it is very inconvenient when partition numbering changes.

Yes, you are right. It's just tht looking at similar paritionning code, like osf, sun, ultrix, I didn't see/know why sgi would be different. but I've never approached an sgi in my life and thus don't know anything about irix partitionnnig uses.

Quoted 2 lines

But here the 2.6 behaviour is already that of 2.4.21, and you change away from that. Not a good idea.

Agreed, obviously.

ghoz