public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>
Subject: [PATCH] sun disk label: fix signed int usage for sector count
Date: Fri, 25 Aug 2006 12:04:58 -0400	[thread overview]
Message-ID: <44EF1FAA.7000108@suse.com> (raw)

 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@suse.com>

--- 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

             reply	other threads:[~2006-08-25 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-25 16:04 Jeff Mahoney [this message]
2006-08-26  7:32 ` [PATCH] sun disk label: fix signed int usage for sector count Jan Engelhardt
2006-08-26 16:02   ` Jeff Mahoney
2006-08-27  0:02     ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2006-08-29  4:52 Jurzitza, Dieter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44EF1FAA.7000108@suse.com \
    --to=jeffm@suse.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox