svn commit: r228144 - projects/zfsd/head/cddl/sbin/zfsd
Xin LI
delphij at FreeBSD.org
Tue Nov 29 19:47:12 UTC 2011
Author: delphij
Date: Tue Nov 29 19:47:11 2011
New Revision: 228144
URL: http://svn.freebsd.org/changeset/base/228144
Log:
Handle ZfsdException while parsing the pool and give more meaningful log
instead of stopping and start over in the main loop.
Modified:
projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc
Modified: projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc
==============================================================================
--- projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc Tue Nov 29 19:46:17 2011 (r228143)
+++ projects/zfsd/head/cddl/sbin/zfsd/dev_ctl_event.cc Tue Nov 29 19:47:11 2011 (r228144)
@@ -455,9 +455,18 @@ DevfsEvent::ReadLabel(int devFd, bool &i
|| devLabel == NULL)
return (NULL);
- Vdev vdev(devLabel);
- degraded = vdev.State() != VDEV_STATE_HEALTHY;
- return (devLabel);
+ try {
+ Vdev vdev(devLabel);
+ degraded = vdev.State() != VDEV_STATE_HEALTHY;
+ return (devLabel);
+ } catch (ZfsdException &exp) {
+ string devName = fdevname(devFd);
+ string devPath = _PATH_DEV + devName;
+ string context("DevfsEvent::ReadLabel: " + devPath + ": ");
+
+ exp.GetString().insert(0, context);
+ exp.Log();
+ }
}
return (NULL);
}
More information about the svn-src-projects
mailing list