svn commit: r298719 - projects/zfsd/head/cddl/sbin/zfsd

Alan Somers asomers at FreeBSD.org
Wed Apr 27 20:12:17 UTC 2016


Author: asomers
Date: Wed Apr 27 20:12:16 2016
New Revision: 298719
URL: https://svnweb.freebsd.org/changeset/base/298719

Log:
  zfsd should attempt to activate a hotspare whenever a vdev becomes UNAVAIL.
  
  This is rare, but sometimes happens when you would expect the REMOVED state
  instead.  I think it happens if vdev_reopen fails before vdev_geom_orphan
  gets called.
  
  Sponsored by:	Spectra Logic Corp

Modified:
  projects/zfsd/head/cddl/sbin/zfsd/case_file.cc

Modified: projects/zfsd/head/cddl/sbin/zfsd/case_file.cc
==============================================================================
--- projects/zfsd/head/cddl/sbin/zfsd/case_file.cc	Wed Apr 27 20:09:02 2016	(r298718)
+++ projects/zfsd/head/cddl/sbin/zfsd/case_file.cc	Wed Apr 27 20:12:16 2016	(r298719)
@@ -442,11 +442,12 @@ CaseFile::ReEvaluate(const ZfsEvent &eve
 	} else if (event.Value("class") == "resource.fs.zfs.statechange") {
 		RefreshVdevState();
 		/*
-		 * If this vdev is DEGRADED or FAULTED, try to activate a
-		 * hotspare.  Otherwise, ignore the event
+		 * If this vdev is DEGRADED, FAULTED, or UNAVAIL, try to
+		 * activate a hotspare.  Otherwise, ignore the event
 		 */
 		if (VdevState() == VDEV_STATE_FAULTED ||
-		    VdevState() == VDEV_STATE_DEGRADED)
+		    VdevState() == VDEV_STATE_DEGRADED ||
+		    VdevState() == VDEV_STATE_CANT_OPEN)
 			(void) ActivateSpare();
 		consumed = true;
 	}


More information about the svn-src-projects mailing list