Date: Sun, 6 Feb 2011 08:46:37 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r218364 - projects/graid/head/sys/geom/raid Message-ID: <201102060846.p168kbwx057829@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102060846.p168kbwx057829>