public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* AW: fix 2.4.33.3 / sun partition size
@ 2006-09-13  5:40 Jurzitza, Dieter
  2006-09-16 21:33 ` Willy Tarreau
  0 siblings, 1 reply; 5+ messages in thread
From: Jurzitza, Dieter @ 2006-09-13  5:40 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: linux-kernel, Jeff Mahoney, sparclinux, davem

Dear Willy,
one final thougth here: ist there any real reason to *not* make
add_gd_partition (struct gendisk, int minor, unsigned long start, unsigned long size){...}
(see fs/partitions/check.c)
as:

- within add_gd_partition the two values start and size are assigned to a field of type unsigned long,
- we both agree that there is no reason to use signed ints in this case,
- any byte size conversion issue would be covered by the fact that it does not hurt assigning too small numbers to oversized ones.

Just my two cents here ...

Take care




Dieter


-- 
________________________________________________

HARMAN BECKER AUTOMOTIVE SYSTEMS

Dr.-Ing. Dieter Jurzitza
Manager Hardware Systems
   System Development

Industriegebiet Ittersbach
Becker-Göring Str. 16
D-76307 Karlsbad / Germany

Phone: +49 (0)7248 71-1577
Fax:   +49 (0)7248 71-1216
eMail: DJurzitza@harmanbecker.com
Internet: http://www.becker.de
 


*******************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
 
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
*******************************************


^ permalink raw reply	[flat|nested] 5+ messages in thread
* fix 2.4.33.3 / sun partition size
@ 2006-09-12 11:23 Jurzitza, Dieter
  2006-09-12 19:17 ` Willy Tarreau
  0 siblings, 1 reply; 5+ messages in thread
From: Jurzitza, Dieter @ 2006-09-12 11:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jeff Mahoney, sparclinux

Kernel: 2.4.33

Issue: really fix size display for sun partitions larger than 1TByte

Signed off by: Dieter Jurzitza DJurzitza@HarmanBecker.com

Problem: the last fix introduced by Jeff Mahoney for kernel 2.6 was not complete for kernel 2.4 (as applied)
I found out that add_gd_partition is called by any type of partition (2.4). add_gd_partition is defined as add_gd_partition (int, int), what makes no sense to me as negative numbers should never occur here. As long as add_gd_partition is not changed to add_gd_partition (unsigned, unsigned), /proc/partitions will keep showing negative numbers.

If ever someone could look into this, within the different partition type files in linux/fs/partitions the parameters to add_gd_partitions seem to be chosen arbitrarily between int, unsigned and unsigned long, whatever seemed to be appropriate, I think it would make sense to get consistent parameters to add_gd_partition from all partition types here.
Especially if one takes into account that sizeof (long) and sizeof (int) may differ significantly i. e. on sparc.


Take care


Dieter Jurzitza



--- linux/fs/partitions/sun.c   2002-11-29 00:53:15.000000000 +0100
+++ linux/fs/partitions/sun.c   2006-08-29 07:04:56.000000000 +0200
@@ -86,7 +86,7 @@
        spc = be16_to_cpu(label->ntrks) * be16_to_cpu(label->nsect);
        for (i = 0; i < 8; i++, p++) {
                unsigned long st_sector;
-               int num_sectors;
+               unsigned int num_sectors;
 
                st_sector = first_sector + be32_to_cpu(p->start_cylinder) * spc;
                num_sectors = be32_to_cpu(p->num_sectors);
--- linux/fs/partitions/check.c 2006-08-31 19:03:20.000000000 +0200
+++ linux/fs/partitions/check.c 2006-09-03 12:47:55.000000000 +0200
@@ -204,7 +204,7 @@
 /*
  * Add a partitions details to the devices partition description.
  */
-void add_gd_partition(struct gendisk *hd, int minor, int start, int size)
+void add_gd_partition(struct gendisk *hd, int minor, unsigned int start, unsign
ed int size)
 {
 #ifndef CONFIG_DEVFS_FS
        char buf[40];
--- linux/fs/partitions/check.h 2006-08-31 19:03:20.000000000 +0200
+++ linux/fs/partitions/check.h 2006-09-03 12:48:54.000000000 +0200
@@ -2,7 +2,7 @@
  * add_partition adds a partitions details to the devices partition
  * description.
  */
-void add_gd_partition(struct gendisk *hd, int minor, int start, int size);
+void add_gd_partition(struct gendisk *hd, int minor, unsigned int start, unsign
ed int size);
 
 typedef struct {struct page *v;} Sector;
 


-- 
________________________________________________

HARMAN BECKER AUTOMOTIVE SYSTEMS

Dr.-Ing. Dieter Jurzitza
Manager Hardware Systems
   System Development

Industriegebiet Ittersbach
Becker-Göring Str. 16
D-76307 Karlsbad / Germany

Phone: +49 (0)7248 71-1577
Fax:   +49 (0)7248 71-1216
eMail: DJurzitza@harmanbecker.com
Internet: http://www.becker.de
 


*******************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und loeschen Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
 
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and delete this e-mail. Any unauthorized copying, disclosure or distribution of the contents in this e-mail is strictly forbidden.
*******************************************


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-09-16 22:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-13  5:40 AW: fix 2.4.33.3 / sun partition size Jurzitza, Dieter
2006-09-16 21:33 ` Willy Tarreau
  -- strict thread matches above, loose matches on Subject: below --
2006-09-12 11:23 Jurzitza, Dieter
2006-09-12 19:17 ` Willy Tarreau
2006-09-12 22:17   ` Tom 'spot' Callaway

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox