diff options
author | Karel Zak | 2014-12-04 10:27:39 +0100 |
---|---|---|
committer | Karel Zak | 2014-12-04 10:27:39 +0100 |
commit | 19ff8ff7c448e4e88e602dde0af4230bff5b4daa (patch) | |
tree | 489b3709b6c98b9970dc5fc97cb68079f29db6cc /libfdisk/src/alignment.c | |
parent | lsblk: add SUBSYSTEMS column (diff) | |
download | kernel-qcow2-util-linux-19ff8ff7c448e4e88e602dde0af4230bff5b4daa.tar.gz kernel-qcow2-util-linux-19ff8ff7c448e4e88e602dde0af4230bff5b4daa.tar.xz kernel-qcow2-util-linux-19ff8ff7c448e4e88e602dde0af4230bff5b4daa.zip |
libfdisk: fix cfdisk freespace analyze
The problem is how fdisk_partition_cmp_start() compare numbers, the
function returns result from "a->start - b->start", unfortunately the
numbers are uint64, but function returns "int".
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1170191
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libfdisk/src/alignment.c')
-rw-r--r-- | libfdisk/src/alignment.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libfdisk/src/alignment.c b/libfdisk/src/alignment.c index 93cb80b32..b1f3ee5c3 100644 --- a/libfdisk/src/alignment.c +++ b/libfdisk/src/alignment.c @@ -416,6 +416,10 @@ int fdisk_discover_geometry(struct fdisk_context *cxt) if (!blkdev_get_sectors(cxt->dev_fd, &nsects)) cxt->total_sectors = (nsects / (cxt->sector_size >> 9)); + DBG(CXT, ul_debugobj(cxt, "total sectors: %ju (ioctl=%ju)", + (uintmax_t) cxt->total_sectors, + (uintmax_t) nsects)); + /* what the kernel/bios thinks the geometry is */ blkdev_get_geometry(cxt->dev_fd, &cxt->geom.heads, (unsigned int *) &cxt->geom.sectors); |