[Midnightbsd-cvs] src [8688] trunk/sys/geom/raid/md_intel.c: windows handles INIT and verify as array-wide and it does not specify which disks should be rebuilt.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 25 18:07:25 EDT 2016


Revision: 8688
          http://svnweb.midnightbsd.org/src/?rev=8688
Author:   laffer1
Date:     2016-09-25 18:07:25 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
windows handles INIT and verify as array-wide and it does not specify which disks should be rebuilt.

Modified Paths:
--------------
    trunk/sys/geom/raid/md_intel.c

Modified: trunk/sys/geom/raid/md_intel.c
===================================================================
--- trunk/sys/geom/raid/md_intel.c	2016-09-25 22:06:37 UTC (rev 8687)
+++ trunk/sys/geom/raid/md_intel.c	2016-09-25 22:07:25 UTC (rev 8688)
@@ -774,7 +774,7 @@
 	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 @@
 		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 @@
 					    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 @@
 				/* 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);



More information about the Midnightbsd-cvs mailing list