svn commit: r218407 - projects/graid/head/sys/geom/raid
Alexander Motin
mav at FreeBSD.org
Mon Feb 7 16:33:01 UTC 2011
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,
More information about the svn-src-projects
mailing list