Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Feb 2011 14:58:29 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r218399 - projects/graid/head/sys/geom/raid
Message-ID:  <201102071458.p17EwUpX012765@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Mon Feb  7 14:58:29 2011
New Revision: 218399
URL: http://svn.freebsd.org/changeset/base/218399

Log:
  Update metadata pointer obsoleted by metadata write. This fixes unneeded
  geom retaste call or possibly even panic.

Modified:
  projects/graid/head/sys/geom/raid/md_intel.c

Modified: projects/graid/head/sys/geom/raid/md_intel.c
==============================================================================
--- projects/graid/head/sys/geom/raid/md_intel.c	Mon Feb  7 11:20:58 2011	(r218398)
+++ projects/graid/head/sys/geom/raid/md_intel.c	Mon Feb  7 14:58:29 2011	(r218399)
@@ -793,7 +793,7 @@ g_raid_md_intel_refill(struct g_raid_sof
 	struct intel_raid_conf *meta;
 	struct g_raid_disk *disk;
 	struct task *task;
-	int update;
+	int update, na;
 
 	md = sc->sc_md;
 	mdi = (struct g_raid_md_intel_object *)md;
@@ -801,11 +801,12 @@ g_raid_md_intel_refill(struct g_raid_sof
 	update = 0;
 	do {
 		/* Make sure we miss anything. */
-		if (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) ==
-		    meta->total_disks)
+		na = g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE);
+		if (na == meta->total_disks)
 			break;
 
-		G_RAID_DEBUG(1, "Array is not complete, trying to refill.");
+		G_RAID_DEBUG(1, "Array is not complete (%d of %d), "
+		    "trying to refill.", na, meta->total_disks);
 
 		/* Try to get use some of STALE disks. */
 		TAILQ_FOREACH(disk, &sc->sc_disks, d_next) {
@@ -829,8 +830,10 @@ g_raid_md_intel_refill(struct g_raid_sof
 	} while (disk != NULL);
 
 	/* Write new metadata if we changed something. */
-	if (update)
+	if (update) {
 		g_raid_md_write_intel(md, NULL, NULL, NULL);
+		meta = mdi->mdio_meta;
+	}
 
 	/* Update status of our need for spare. */
 	mdi->mdio_incomplete = (g_raid_ndisks(sc, G_RAID_DISK_S_ACTIVE) <



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