Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jan 2013 22:19:40 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r246176 - stable/8/sys/geom/raid
Message-ID:  <201301312219.r0VMJe6P048738@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Thu Jan 31 22:19:39 2013
New Revision: 246176
URL: http://svnweb.freebsd.org/changeset/base/246176

Log:
  MFC r245341:
  Windows handles INIT and VERIFY as array-wide and it doesn't specify which
  disks should be rebuilt. Our rebuild code is same time disk-centric.  To
  handle this situation  properly check all disks for RBLD flags, and if no
  disk specified try rebuild/resync all of them except newly inserted.

Modified:
  stable/8/sys/geom/raid/md_intel.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/geom/   (props changed)

Modified: stable/8/sys/geom/raid/md_intel.c
==============================================================================
--- stable/8/sys/geom/raid/md_intel.c	Thu Jan 31 22:18:40 2013	(r246175)
+++ stable/8/sys/geom/raid/md_intel.c	Thu Jan 31 22:19:39 2013	(r246176)
@@ -774,7 +774,7 @@ g_raid_md_intel_start_disk(struct g_raid
 	struct intel_raid_conf *meta;
 	struct intel_raid_vol *mvol;
 	struct intel_raid_map *mmap0, *mmap1;
-	int disk_pos, resurrection = 0;
+	int disk_pos, resurrection = 0, migr_global, i;
 
 	sc = disk->d_softc;
 	md = sc->sc_md;
@@ -903,6 +903,13 @@ nofit:
 		else
 			mmap1 = mmap0;
 
+		migr_global = 1;
+		for (i = 0; i < mmap0->total_disks; i++) {
+			if ((mmap0->disk_idx[i] & INTEL_DI_RBLD) == 0 &&
+			    (mmap1->disk_idx[i] & INTEL_DI_RBLD) != 0)
+				migr_global = 0;
+		}
+
 		if (resurrection) {
 			/* Stale disk, almost same as new. */
 			g_raid_change_subdisk_state(sd,
@@ -953,6 +960,11 @@ nofit:
 					    sd->sd_volume->v_strip_size *
 					    mmap0->total_domains;
 				}
+			} else if (mvol->migr_type == INTEL_MT_INIT &&
+			    migr_global) {
+				/* Freshly created uninitialized volume. */
+				g_raid_change_subdisk_state(sd,
+				    G_RAID_SUBDISK_S_UNINITIALIZED);
 			} else if (mvol->dirty && (!pv->pv_cng ||
 			    pv->pv_cng_master_disk != disk_pos)) {
 				/* Dirty volume (unclean shutdown). */
@@ -969,7 +981,8 @@ nofit:
 				/* Freshly inserted disk. */
 				g_raid_change_subdisk_state(sd,
 				    G_RAID_SUBDISK_S_NEW);
-			} else if (mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) {
+			} else if ((mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) ||
+			    migr_global) {
 				/* Resyncing disk. */
 				g_raid_change_subdisk_state(sd,
 				    G_RAID_SUBDISK_S_RESYNC);



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