Date: Mon, 7 Feb 2011 16:33:00 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r218407 - projects/graid/head/sys/geom/raid Message-ID: <201102071633.p17GX0OT015365@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Mon Feb 7 16:33:00 2011 New Revision: 218407 URL: http://svn.freebsd.org/changeset/base/218407 Log: After unclean shutdown we have to restart rebuild and resync processes from the beginning. We can't trust completed portions synchronicity. 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 16:14:12 2011 (r218406) +++ projects/graid/head/sys/geom/raid/md_intel.c Mon Feb 7 16:33:00 2011 (r218407) @@ -737,10 +737,14 @@ nofit: /* Rebuilding disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_REBUILD); - sd->sd_rebuild_pos = - (off_t)mvol->curr_migr_unit * - sd->sd_volume->v_strip_size * - mmap0->total_domains; + if (mvol->dirty) { + sd->sd_rebuild_pos = 0; + } else { + sd->sd_rebuild_pos = + (off_t)mvol->curr_migr_unit * + sd->sd_volume->v_strip_size * + mmap0->total_domains; + } } } else if (mvol->migr_type == INTEL_MT_VERIFY || mvol->migr_type == INTEL_MT_REPAIR) { @@ -756,10 +760,14 @@ nofit: /* Resyncing disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_RESYNC); - sd->sd_rebuild_pos = - (off_t)mvol->curr_migr_unit * - sd->sd_volume->v_strip_size * - mmap0->total_domains; + if (mvol->dirty) { + sd->sd_rebuild_pos = 0; + } else { + sd->sd_rebuild_pos = + (off_t)mvol->curr_migr_unit * + sd->sd_volume->v_strip_size * + mmap0->total_domains; + } } } g_raid_event_send(sd, G_RAID_SUBDISK_E_NEW,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102071633.p17GX0OT015365>