svn commit: r218364 - projects/graid/head/sys/geom/raid
Alexander Motin
mav at FreeBSD.org
Sun Feb 6 08:46:37 UTC 2011
Author: mav
Date: Sun Feb 6 08:46:37 2011
New Revision: 218364
URL: http://svn.freebsd.org/changeset/base/218364
Log:
Use circular comparision of generations. If (unlikely) generations counter
will ever wrap around, such logic may give a bit more reliable detection
of the newest metadata copy. It is based on assumtion that all disk's
metadata updated same time and should stay close and no disk should rejoin
the array after being offline/failed/stale for more then half of generation
counter wrap period. In last case this question just has no valid answer.
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 Sun Feb 6 07:41:27 2011 (r218363)
+++ projects/graid/head/sys/geom/raid/md_intel.c Sun Feb 6 08:46:37 2011 (r218364)
@@ -964,7 +964,7 @@ g_raid_md_intel_new_disk(struct g_raid_d
} else {
/* If we haven't started yet - check metadata freshness. */
if (mdi->mdio_meta == NULL ||
- pdmeta->generation > mdi->mdio_generation) {
+ ((int32_t)(pdmeta->generation - mdi->mdio_generation)) > 0) {
G_RAID_DEBUG(1, "Newer disk");
if (mdi->mdio_meta != NULL)
free(mdi->mdio_meta, M_MD_INTEL);
More information about the svn-src-projects
mailing list