summaryrefslogtreecommitdiffstats
path: root/sbin/gpt
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-10-23 03:33:06 +0000
committermarcel <marcel@FreeBSD.org>2002-10-23 03:33:06 +0000
commitca968176795f13707779953f73781557cb143f7d (patch)
tree8acf06ea2b5e3fe59665708cc99025027eb6d50a /sbin/gpt
parent22d94f8404dad00a5e11e10268dd1939db2db7aa (diff)
downloadFreeBSD-src-ca968176795f13707779953f73781557cb143f7d.zip
FreeBSD-src-ca968176795f13707779953f73781557cb143f7d.tar.gz
Don't complain if we have an inconsistent map that may be the
result of an incomplete migration. An incomplete migration is one where the MBR is not turned into a PMBR after creating the GPT. This early in the game it's more convenient to allow the inconsistency, because that avoids that we have to destroy the MBR partitioning for now.
Diffstat (limited to 'sbin/gpt')
-rw-r--r--sbin/gpt/map.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/sbin/gpt/map.c b/sbin/gpt/map.c
index 93d0f61..5aba63c 100644
--- a/sbin/gpt/map.c
+++ b/sbin/gpt/map.c
@@ -69,20 +69,25 @@ map_add(off_t start, off_t size, int type, void *data)
}
if (n->map_start == start && n->map_size == size) {
- if (n->map_type != MAP_TYPE_UNUSED)
- warnx("warning: partition(%llu,%llu) mirrored",
- (long long)start, (long long)size);
+ if (n->map_type != MAP_TYPE_UNUSED) {
+ if (n->map_type != MAP_TYPE_MBR_PART ||
+ type != MAP_TYPE_GPT_PART) {
+ warnx("warning: partition(%llu,%llu) mirrored",
+ (long long)start, (long long)size);
+ }
+ }
n->map_type = type;
n->map_data = data;
return (n);
}
if (n->map_type != MAP_TYPE_UNUSED) {
- warnx(
- "error: partition(%llu,%llu) overlaps partition(%llu,%llu)",
- (long long)start, (long long)size,
- (long long)n->map_start, (long long)n->map_size);
- return (0);
+ if (n->map_type != MAP_TYPE_MBR_PART ||
+ type != MAP_TYPE_GPT_PART) {
+ warnx("error: bogus map");
+ return (0);
+ }
+ n->map_type = MAP_TYPE_UNUSED;
}
m = mkmap(start, size, type);
OpenPOWER on IntegriCloud