Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 May 2011 12:00:32 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221984 - head/sys/geom/part
Message-ID:  <201105161200.p4GC0WWf081279@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Mon May 16 12:00:32 2011
New Revision: 221984
URL: http://svn.freebsd.org/changeset/base/221984

Log:
  Add diagnostic messages for integrity checks.

Modified:
  head/sys/geom/part/g_part.c

Modified: head/sys/geom/part/g_part.c
==============================================================================
--- head/sys/geom/part/g_part.c	Mon May 16 07:03:06 2011	(r221983)
+++ head/sys/geom/part/g_part.c	Mon May 16 12:00:32 2011	(r221984)
@@ -245,6 +245,7 @@ g_part_check_integrity(struct g_part_tab
 	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_tab
 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105161200.p4GC0WWf081279>