diff options
author | ae <ae@FreeBSD.org> | 2011-05-16 12:00:32 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2011-05-16 12:00:32 +0000 |
commit | 40e0f433ddd77c3626ec3201fd1c2dfdd3b08af2 (patch) | |
tree | 24e290c0bd5039258a0479b0533eb7cc85f2abfd /sys/geom | |
parent | f1e4896e8a60b8e3344584d371b1d120df7483fd (diff) | |
download | FreeBSD-src-40e0f433ddd77c3626ec3201fd1c2dfdd3b08af2.zip FreeBSD-src-40e0f433ddd77c3626ec3201fd1c2dfdd3b08af2.tar.gz |
Add diagnostic messages for integrity checks.
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/part/g_part.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c index c9ff9c0..eaf24f9 100644 --- a/sys/geom/part/g_part.c +++ b/sys/geom/part/g_part.c @@ -245,6 +245,7 @@ g_part_check_integrity(struct g_part_table *table, struct g_consumer *cp) struct g_part_entry *e1, *e2; struct g_provider *pp; + e1 = e2 = NULL; pp = cp->provider; if (table->gpt_first > table->gpt_last || table->gpt_last > pp->mediasize / pp->sectorsize - 1) @@ -277,6 +278,25 @@ g_part_check_integrity(struct g_part_table *table, struct g_consumer *cp) fail: printf("GEOM_PART: integrity check failed (%s, %s)\n", pp->name, table->gpt_scheme->name); + if (bootverbose) { + if (e1 == NULL) + printf("GEOM_PART: invalid geom configuration:\n"); + else if (e2 == NULL) + printf("GEOM_PART: invalid partition entry:\n"); + else + printf("GEOM_PART: overlapped partition entries:\n"); + if (e1 != NULL) + printf("GEOM_PART: index: %d, start: %jd, end: %jd\n", + e1->gpe_index, + (intmax_t)e1->gpe_start, (intmax_t)e1->gpe_end); + if (e2 != NULL) + printf("GEOM_PART: index: %d, start: %jd, end: %jd\n", + e2->gpe_index, + (intmax_t)e2->gpe_start, (intmax_t)e2->gpe_end); + printf("GEOM_PART: first: %jd, last: %jd, sectors: %jd\n", + (intmax_t)table->gpt_first, (intmax_t)table->gpt_last, + (intmax_t)pp->mediasize / pp->sectorsize - 1); + } if (check_integrity == 0) { table->gpt_corrupt = 1; return (0); |