From: Karel Zak Date: Tue, 14 Feb 2017 13:57:24 +0000 (+0100) Subject: libblkid: fix BLKID_PARTS_FORCE_GPT usage X-Git-Tag: v2.30-rc1~249 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=74493d48d8c9c710ec5c9cbf9503ab082db64d4f;p=thirdparty%2Futil-linux.git libblkid: fix BLKID_PARTS_FORCE_GPT usage Now wipefs always inform about MBR as about PMBR. That's bug. Signed-off-by: Karel Zak --- diff --git a/libblkid/src/partitions/gpt.c b/libblkid/src/partitions/gpt.c index d987236d3e..1f75e592c0 100644 --- a/libblkid/src/partitions/gpt.c +++ b/libblkid/src/partitions/gpt.c @@ -167,7 +167,7 @@ static int is_pmbr_valid(blkid_probe pr, int *has) if (has) *has = 0; if (flags & BLKID_PARTS_FORCE_GPT) - goto ok; /* skip PMBR check */ + return 1; /* skip PMBR check */ data = blkid_probe_get_sector(pr, 0); if (!data) { @@ -180,8 +180,10 @@ static int is_pmbr_valid(blkid_probe pr, int *has) goto failed; for (i = 0, p = mbr_get_partition(data, 0); i < 4; i++, p++) { - if (p->sys_ind == MBR_GPT_PARTITION) + if (p->sys_ind == MBR_GPT_PARTITION) { + DBG(LOWPROBE, ul_debug(" #%d valid PMBR partition", i + 1)); goto ok; + } } failed: return 0; @@ -215,6 +217,8 @@ static struct gpt_header *get_gpt_header( ssz = blkid_probe_get_sectorsize(pr); + DBG(LOWPROBE, ul_debug(" checking for GPT header at %ju", lba)); + /* whole sector is allocated for GPT header */ h = (struct gpt_header *) get_lba_buffer(pr, lba, ssz); if (!h)