diff usr/src/uts/common/io/lvm/mirror/mirror.c @ 7627:8599a7568728

6743774 TSlvm tests cause kernel deadlocks on md_unit_array_rw and md_devinfo->devi_cv 6744223 SVM root with snv_97 on sparc hangs system with threads in ndi_devi_enter 6746854 mdprop_op can deadlock with md ioctl resolving a devid
author Chris Horne <Chris.Horne@Sun.COM>
date Wed, 17 Sep 2008 20:24:52 -0600
parents 307e592cef33
children f7037f0cdac8
line wrap: on
line diff
--- a/usr/src/uts/common/io/lvm/mirror/mirror.c	Thu Sep 18 08:26:20 2008 +0800
+++ b/usr/src/uts/common/io/lvm/mirror/mirror.c	Wed Sep 17 20:24:52 2008 -0600
@@ -18,13 +18,12 @@
  *
  * CDDL HEADER END
  */
+
 /*
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/conf.h>
@@ -1884,7 +1883,10 @@
 	mutex_init(&un->un_dmr_mx, NULL, MUTEX_DEFAULT, NULL);
 	cv_init(&un->un_dmr_cv, NULL, CV_DEFAULT, NULL);
 
+	/* place various information in the in-core data structures */
+	md_nblocks_set(MD_SID(un), un->c.un_total_blocks);
 	MD_UNIT(MD_SID(un)) = un;
+
 	return (0);
 }
 
@@ -1916,6 +1918,7 @@
 	if (un->un_resync_bm)
 		kmem_free((caddr_t)un->un_resync_bm, bitcnt);
 
+	md_nblocks_set(mnum, -1ULL);
 	MD_UNIT(mnum) = NULL;
 
 	/*