Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jun 2010 11:24:10 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209098 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201006121124.o5CBOAVK084261@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mm
Date: Sat Jun 12 11:24:10 2010
New Revision: 209098
URL: http://svn.freebsd.org/changeset/base/209098

Log:
  Fix zpool resilver stalls with spa_scrub_thread in a 3 way deadlock
  
  OpenSolaris onnv-revision:	9997:174d75a29a1c
  
  Obtained from:	OpenSolaris (Bug ID 6843235)
  Approved by:	pjd, delphij (mentor)
  MFC after:	3 days

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c	Sat Jun 12 11:22:45 2010	(r209097)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c	Sat Jun 12 11:24:10 2010	(r209098)
@@ -1008,6 +1008,8 @@ dsl_pool_scrub_clean_cb(dsl_pool_t *dp,
 int
 dsl_pool_scrub_clean(dsl_pool_t *dp)
 {
+	spa_t *spa = dp->dp_spa;
+
 	/*
 	 * Purge all vdev caches.  We do this here rather than in sync
 	 * context because this requires a writer lock on the spa_config
@@ -1015,11 +1017,11 @@ dsl_pool_scrub_clean(dsl_pool_t *dp)
 	 * spa_scrub_reopen flag indicates that vdev_open() should not
 	 * attempt to start another scrub.
 	 */
-	spa_config_enter(dp->dp_spa, SCL_ALL, FTAG, RW_WRITER);
-	dp->dp_spa->spa_scrub_reopen = B_TRUE;
-	vdev_reopen(dp->dp_spa->spa_root_vdev);
-	dp->dp_spa->spa_scrub_reopen = B_FALSE;
-	spa_config_exit(dp->dp_spa, SCL_ALL, FTAG);
+	spa_vdev_state_enter(spa);
+	spa->spa_scrub_reopen = B_TRUE;
+	vdev_reopen(spa->spa_root_vdev);
+	spa->spa_scrub_reopen = B_FALSE;
+	(void) spa_vdev_state_exit(spa, NULL, 0);
 
 	return (dsl_pool_scrub_setup(dp, SCRUB_FUNC_CLEAN));
 }



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