gmirror RAID-1: rebuilding freezes machine

Michael Butler imb at protected-networks.net
Wed Sep 6 18:04:00 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm backing out the attached change to see if it fixes it ..

	Michael

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)

iD8DBQFE/2/mQv9rrgRC1JIRArNYAJsEuTtrmig9bdW4aDQQ8W1May+EfQCfUjDQ
Xc1A9gUrrLS2jgbDP4xyC7I=
=5DtW
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: src/sys/geom/mirror/g_mirror.c
===================================================================
RCS file: /usr/home/ncvs/src/sys/geom/mirror/g_mirror.c,v
retrieving revision 1.66.2.7
retrieving revision 1.66.2.8
diff -u -r1.66.2.7 -r1.66.2.8
--- src/sys/geom/mirror/g_mirror.c	16 Jul 2006 15:47:46 -0000	1.66.2.7
+++ src/sys/geom/mirror/g_mirror.c	4 Sep 2006 12:55:43 -0000	1.66.2.8
@@ -1813,12 +1813,19 @@
 		bioq_remove(&sc->sc_queue, bp);
 		mtx_unlock(&sc->sc_queue_mtx);
 
-		if ((bp->bio_cflags & G_MIRROR_BIO_FLAG_REGULAR) != 0)
-			g_mirror_regular_request(bp);
-		else if ((bp->bio_cflags & G_MIRROR_BIO_FLAG_SYNC) != 0)
-			g_mirror_sync_request(bp);
-		else
+		if (bp->bio_to != sc->sc_provider) {
+			if ((bp->bio_cflags & G_MIRROR_BIO_FLAG_REGULAR) != 0)
+				g_mirror_regular_request(bp);
+			else if ((bp->bio_cflags & G_MIRROR_BIO_FLAG_SYNC) != 0)
+				g_mirror_sync_request(bp);
+			else {
+				KASSERT(0,
+				    ("Invalid request cflags=0x%hhx to=%s.",
+				    bp->bio_cflags, bp->bio_to->name));
+			}
+		} else {
 			g_mirror_register_request(bp);
+		}
 		G_MIRROR_DEBUG(5, "%s: I'm here 9.", __func__);
 	}
 }


More information about the freebsd-stable mailing list