[PATCH] sun disk label: fix signed int usage for sector count
- From: Jeff Mahoney <jeffm@xxxxxxxx>
- Date: Fri, 25 Aug 2006 12:04:58 -0400
The current sun disklabel code uses a signed int for the sector count. When
partitions larger than 1 TB are used, the cast to a sector_t causes the
partition sizes to be invalid:
# cat /proc/paritions | grep sdan
66 112 2146435072 sdan
66 115 9223372036853660736 sdan3
66 120 9223372036853660736 sdan8
This patch switches the sector count to an unsigned int to fix this.
Signed-off-by: Jeff Mahoney <jeffm@xxxxxxxx>
--- linux-2.6.5/fs/partitions/sun.c 2004-04-03 22:38:14.000000000 -0500
+++ linux-2.6.5.fix/fs/partitions/sun.c 2006-08-25 11:54:23.000000000 -0400
@@ -73,7 +73,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 = be32_to_cpu(p->start_cylinder) * spc;
num_sectors = be32_to_cpu(p->num_sectors);
--
Jeff Mahoney
SUSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] sun disk label: fix signed int usage for sector count
- From: Jan Engelhardt
- Re: [PATCH] sun disk label: fix signed int usage for sector count
- Prev by Date: Re: [PATCH 0/4] VM deadlock prevention -v5
- Next by Date: Re: [PATCH 03/17] BLOCK: Stop fallback_migrate_page() from using page_has_buffers() [try #2]
- Previous by thread: [PATCH 0/4] VM deadlock prevention -v5
- Next by thread: Re: [PATCH] sun disk label: fix signed int usage for sector count
- Index(es):
Relevant Pages
|