diff options
author | Kunihiko IMAI | 2007-08-20 14:12:53 +0200 |
---|---|---|
committer | Karel Zak | 2007-12-04 14:38:32 +0100 |
commit | 5119dec449a8d7c07bf01947e957b862035e1260 (patch) | |
tree | 087a0fffc0c6210341bc2b40930ba7f9ab545c3d /fdisk | |
parent | losetup: use standard uintxy_t types (struct loop_info64) (diff) | |
download | kernel-qcow2-util-linux-5119dec449a8d7c07bf01947e957b862035e1260.tar.gz kernel-qcow2-util-linux-5119dec449a8d7c07bf01947e957b862035e1260.tar.xz kernel-qcow2-util-linux-5119dec449a8d7c07bf01947e957b862035e1260.zip |
sfdisk: allow partitioning drives of over 2^31 sectors.
sfdisk would incorrectly complain that there was no room when partitioning
a drive over 2^31 sectors in size.
Signed-off-by: LaMont Jones <lamont@mmjgroup.com>
Diffstat (limited to 'fdisk')
-rw-r--r-- | fdisk/sfdisk.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c index 99e165efa..a3b66174f 100644 --- a/fdisk/sfdisk.c +++ b/fdisk/sfdisk.c @@ -1927,11 +1927,12 @@ compute_start_sect(struct part_desc *p, struct part_desc *ep) { delta = 0; if (delta < 0) { + unsigned long old_size = p->size; p->start -= delta; p->size += delta; if (is_extended(p->p.sys_type) && boxes == ONESECTOR) p->size = inc; - else if ((int)(p->size) <= 0) { + else if (old_size <= -delta) { warn(_("no room for partition descriptor\n")); return 0; } |