On Mon, Aug 20, 2007 at 06:12:53AM -0600, LaMont Jones wrote:
> From 05b04cf2c5237e299c959d59730648f711faf373 Mon Sep 17 00:00:00 2001
> From: Kunihiko IMAI <[EMAIL PROTECTED]>
> Date: Sun, 19 Aug 2007 12:28:37 -0600
> Subject: [PATCH] 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 <[EMAIL PROTECTED]>
Applied, thanks.
> ---
> fdisk/sfdisk.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/fdisk/sfdisk.c b/fdisk/sfdisk.c
> index 29f66cc..1241f66 100644
> --- a/fdisk/sfdisk.c
> +++ b/fdisk/sfdisk.c
> @@ -1925,11 +1925,12 @@ compute_start_sect(struct part_desc *p, struct
> part_desc *ep) {
The function compute_start_sect() is nothing nice. For example
int delta;
delta = p->start - ep->start - inc;
where '->start' are unsigned long, but probably good enough for real life...
> 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;
> }
--
Karel Zak <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html