]> git.ipfire.org Git - thirdparty/util-linux.git/commit
sfdisk: fix calculation due to type mismatch (ix86)
authorPetr Uzel <petr.uzel@suse.cz>
Fri, 6 Apr 2012 14:53:13 +0000 (16:53 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 10 Apr 2012 10:21:49 +0000 (12:21 +0200)
commit9c45d49fe01c1c8f971d7d2d664e40dd82d00cf5
tree8264b5f880cb27bdbe0cd6215bc4f96e5a50adf5
parent0b66315a8e6d6744e25f63ff405f80eef83b7d48
sfdisk: fix calculation due to type mismatch (ix86)

Instructing sfdisk to create one partition spanning
across entire disk (",,") on 32bit system, if the disk
is sufficiently large (~2TB) leads to wrong calculation
in compute_start_sect() due to type mismatch.

Can be reproduced as:

--------------------------
linux-3ln5:~ # modprobe scsi_debug virtual_gb=2000
linux-3ln5:~ # sfdisk /dev/sda <<< ',,'
Checking that no-one is using this disk right now ...
OK

Disk /dev/sda: 261083 cylinders, 255 heads, 63 sectors/track

sfdisk: ERROR: sector 0 does not have an msdos signature
sfdisk:  /dev/sda: unrecognized partition table type

Old situation:
sfdisk: No partitions found

no room for partition descriptor
sfdisk: bad input
--------------------------

Addresses: https://bugzilla.novell.com/show_bug.cgi?id=754789
Reported-by: Dan Mares <dan.mares@norcrossgroup.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
fdisk/sfdisk.c