aboutsummaryrefslogtreecommitdiff
path: root/sbin/gpt/map.c
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2002-10-23 03:33:06 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2002-10-23 03:33:06 +0000
commitfec26e0e4c415446caa9d13d63ba1ac771abf196 (patch)
tree8acf06ea2b5e3fe59665708cc99025027eb6d50a /sbin/gpt/map.c
parent1494905bb6e4aab3a0a034b667ac44e091e567d6 (diff)
downloadsrc-fec26e0e4c415446caa9d13d63ba1ac771abf196.tar.gz
src-fec26e0e4c415446caa9d13d63ba1ac771abf196.zip
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.
Notes
Notes: svn path=/head/; revision=105759
Diffstat (limited to 'sbin/gpt/map.c')
-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 93d0f6159a7c..5aba63cd66c9 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);