Author: markj
Date: Tue May  2 23:29:42 2017
New Revision: 317712
URL: https://svnweb.freebsd.org/changeset/base/317712

Log:
  Synchronize unclean mirrors before adding them to a running gmirror.
  
  During gmirror startup, if component mirrors are found to be dirty as is
  typical after a system crash, the mirrors are synchronized to the mirror
  with highest priority. However if a gmirror starts without all of its
  mirrors present, for example because of some transient delays during
  tasting, the remaining mirrors must be synchronized before they may become
  active.
  
  MFC after:    2 weeks
  Sponsored by: Dell EMC Isilon

Modified:
  head/sys/geom/mirror/g_mirror.c

Modified: head/sys/geom/mirror/g_mirror.c
==============================================================================
--- head/sys/geom/mirror/g_mirror.c     Tue May  2 22:57:27 2017        
(r317711)
+++ head/sys/geom/mirror/g_mirror.c     Tue May  2 23:29:42 2017        
(r317712)
@@ -2225,7 +2225,9 @@ g_mirror_determine_state(struct g_mirror
        sc = disk->d_softc;
        if (sc->sc_syncid == disk->d_sync.ds_syncid) {
                if ((disk->d_flags &
-                   G_MIRROR_DISK_FLAG_SYNCHRONIZING) == 0) {
+                   G_MIRROR_DISK_FLAG_SYNCHRONIZING) == 0 &&
+                   (g_mirror_ndisks(sc, G_MIRROR_DISK_STATE_ACTIVE) == 0 ||
+                    (disk->d_flags & G_MIRROR_DISK_FLAG_DIRTY) == 0)) {
                        /* Disk does not need synchronization. */
                        state = G_MIRROR_DISK_STATE_ACTIVE;
                } else {
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to