diff options
author | Karel Zak | 2013-11-01 12:15:25 +0100 |
---|---|---|
committer | Karel Zak | 2013-11-01 12:15:25 +0100 |
commit | 36da6b64c437680bdf58717bf907d23e2a66a406 (patch) | |
tree | 89cc61bddda93be4e53944c2a4a358766727ba35 /libfdisk | |
parent | mount: improve -s man mage info (diff) | |
download | kernel-qcow2-util-linux-36da6b64c437680bdf58717bf907d23e2a66a406.tar.gz kernel-qcow2-util-linux-36da6b64c437680bdf58717bf907d23e2a66a406.tar.xz kernel-qcow2-util-linux-36da6b64c437680bdf58717bf907d23e2a66a406.zip |
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 <psusi@ubuntu.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk')
-rw-r--r-- | libfdisk/src/sun.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, |