diff options
author | Karel Zak | 2017-02-14 14:57:24 +0100 |
---|---|---|
committer | Karel Zak | 2017-02-14 14:57:24 +0100 |
commit | 74493d48d8c9c710ec5c9cbf9503ab082db64d4f (patch) | |
tree | 41bedfc567920e4a5ccee28af32ed7967ac227cf /libblkid | |
parent | libfdisk: (dos) debug what we read from first sector (diff) | |
download | kernel-qcow2-util-linux-74493d48d8c9c710ec5c9cbf9503ab082db64d4f.tar.gz kernel-qcow2-util-linux-74493d48d8c9c710ec5c9cbf9503ab082db64d4f.tar.xz kernel-qcow2-util-linux-74493d48d8c9c710ec5c9cbf9503ab082db64d4f.zip |
libblkid: fix BLKID_PARTS_FORCE_GPT usage
Now wipefs always inform about MBR as about PMBR. That's bug.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r-- | libblkid/src/partitions/gpt.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libblkid/src/partitions/gpt.c b/libblkid/src/partitions/gpt.c index d987236d3..1f75e592c 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) |