Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 May 2010 23:17:45 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r208683 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201005312317.o4VNHjRB052110@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Mon May 31 23:17:45 2010
New Revision: 208683
URL: http://svn.freebsd.org/changeset/base/208683

Log:
  Fix a bug where resilver is not started automatically on pool import or load.
  If disk was missing on pool load or import and on next pool load or import
  it was present, resilver wasn't started automatically and ZFS reported all disks
  as ONLINE and healthy. Then, when another disk died, pool became unaccessible,
  because if it was 2-way mirror or RAIDZ1 two vdevs were out of sync.
  
  To fix the problem, start resilver automatically on pool load or import.
  
  Obtained from:	OpenSolaris
  MFC after:	3 days

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

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Mon May 31 23:11:43 2010	(r208682)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Mon May 31 23:17:45 2010	(r208683)
@@ -1425,6 +1425,12 @@ spa_load(spa_t *spa, nvlist_t *config, s
 		 */
 		if (need_update)
 			spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE);
+
+		/*
+		 * Check all DTLs to see if anything needs resilvering.
+		 */
+		if (vdev_resilver_needed(rvd, NULL, NULL))
+			spa_async_request(spa, SPA_ASYNC_RESILVER);
 	}
 
 	error = 0;



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