From: Karel Zak Date: Mon, 11 Aug 2014 13:59:04 +0000 (+0200) Subject: libblkid: (gpt) fix PT offset X-Git-Tag: v2.26-rc1~529 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=413b91d190457fd7c0a280022c2d9926bb456ff1;p=thirdparty%2Futil-linux.git libblkid: (gpt) fix PT offset Signed-off-by: Karel Zak --- diff --git a/libblkid/src/partitions/gpt.c b/libblkid/src/partitions/gpt.c index 728b6ef377..6ab4f7118f 100644 --- a/libblkid/src/partitions/gpt.c +++ b/libblkid/src/partitions/gpt.c @@ -348,7 +348,8 @@ static int probe_gpt_pt(blkid_probe pr, if (!ls) goto nothing; - tab = blkid_partlist_new_parttable(ls, "gpt", lba << 9); + tab = blkid_partlist_new_parttable(ls, "gpt", + blkid_probe_get_sectorsize(pr) * lba); if (!tab) goto err; diff --git a/libblkid/src/partitions/partitions.c b/libblkid/src/partitions/partitions.c index ce46fb2835..4853f97e29 100644 --- a/libblkid/src/partitions/partitions.c +++ b/libblkid/src/partitions/partitions.c @@ -163,7 +163,7 @@ const struct blkid_chaindrv partitions_drv = { /* exported as opaque type "blkid_parttable" */ struct blkid_struct_parttable { const char *type; /* partition table type */ - blkid_loff_t offset; /* begin of the partition table */ + blkid_loff_t offset; /* begin of the partition table (in bytes) */ int nparts; /* number of partitions */ blkid_partition parent; /* parent of nested partition table */ char id[37]; /* PT identifier (e.g. UUID for GPT) */ @@ -173,8 +173,8 @@ struct blkid_struct_parttable { /* exported as opaque type "blkid_partition" */ struct blkid_struct_partition { - blkid_loff_t start; /* begin of the partition */ - blkid_loff_t size; /* size of the partitions */ + blkid_loff_t start; /* begin of the partition (512-bytes sectors) */ + blkid_loff_t size; /* size of the partitions (512-bytes sectors) */ int type; /* partition type */ char typestr[37]; /* partition type string (GPT and Mac) */