From 36da6b64c437680bdf58717bf907d23e2a66a406 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 1 Nov 2013 12:15:25 +0100 Subject: libfdisk: (sun) fix end sectors with +1 error partx (or parted, etc.): NR START END SECTORS SIZE NAME UUID 1 0 410047 410048 200.2M 2 410048 82329055 81919008 39.1G 4 82329056 102807615 20478560 9.8G 5 102807616 110999039 8191424 3.9G 6 110999040 312580543 201581504 96.1G and the same with fdisk: Device Flag Start End Blocks Id System /dev/loop0p1 0 410048 205024 1 Boot /dev/loop0p2 410048 82329056 40959504 83 Linux native /dev/loop0p3 0 312580544 156290272 5 Whole disk /dev/loop0p4 82329056 102807616 10239280 83 Linux native /dev/loop0p5 102807616 110999040 4095712 83 Linux native /dev/loop0p6 110999040 312580544 100790752 8e Linux LVM Reported-by: Phillip Susi Signed-off-by: Karel Zak --- libfdisk/src/sun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfdisk/src/sun.c b/libfdisk/src/sun.c index d890a32a4..319d8cdd6 100644 --- a/libfdisk/src/sun.c +++ b/libfdisk/src/sun.c @@ -736,7 +736,7 @@ static int sun_list_disklabel(struct fdisk_context *cxt) tt_line_set_data(ln, 1, p); /* flags */ if (asprintf(&p, "%ju", (uintmax_t) fdisk_scround(cxt, start)) > 0) tt_line_set_data(ln, 2, p); /* start */ - if (asprintf(&p, "%ju", (uintmax_t) fdisk_scround(cxt, start + len)) > 0) + if (asprintf(&p, "%ju", (uintmax_t) fdisk_scround(cxt, start + len - 1)) > 0) tt_line_set_data(ln, 3, p); /* end */ if (asprintf(&p, "%lu%c", (unsigned long) len / 2, -- cgit v1.2.3-55-g7522