svn commit: r208683 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Pawel Jakub Dawidek pjd at FreeBSD.org
Mon May 31 23:17:45 UTC 2010


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;


More information about the svn-src-head mailing list