svn commit: r362638 - in stable: 11/lib/libdevdctl 12/lib/libdevdctl

Ryan Moeller freqlabs at FreeBSD.org
Fri Jun 26 00:58:59 UTC 2020


Author: freqlabs
Date: Fri Jun 26 00:58:59 2020
New Revision: 362638
URL: https://svnweb.freebsd.org/changeset/base/362638

Log:
  MFC r362544:
  
  libdevdctl: Force full match of "timestamp" field name
  
  OpenZFS generates events with a "zio_timestamp" field, which gets mistaken for
  "timestamp" by libdevdctl due to imprecise string matching.  Then later it is
  assumed a "timestamp" field exists when it doesn't and an exception is thrown.
  
  Add a space to the search string so we match exactly "timestamp" rather than
  anything with that as a suffix.
  
  Approved by:    mav (mentor)
  Sponsored by:   iXsystems, Inc.

Modified:
  stable/11/lib/libdevdctl/event.cc
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/lib/libdevdctl/event.cc
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/lib/libdevdctl/event.cc
==============================================================================
--- stable/11/lib/libdevdctl/event.cc	Fri Jun 26 00:01:31 2020	(r362637)
+++ stable/11/lib/libdevdctl/event.cc	Fri Jun 26 00:58:59 2020	(r362638)
@@ -427,7 +427,7 @@ Event::TimestampEventString(std::string &eventString)
 		 * Add a timestamp as the final field of the event if it is
 		 * not already present.
 		 */
-		if (eventString.find("timestamp=") == string::npos) {
+		if (eventString.find(" timestamp=") == string::npos) {
 			const size_t bufsize = 32;	// Long enough for a 64-bit int
 			timeval now;
 			char timebuf[bufsize];


More information about the svn-src-stable mailing list