svn commit: r334141 - head/sys/dev/xen/xenstore

Roger Pau Monné royger at FreeBSD.org
Thu May 24 10:17:04 UTC 2018


Author: royger
Date: Thu May 24 10:17:03 2018
New Revision: 334141
URL: https://svnweb.freebsd.org/changeset/base/334141

Log:
  xenstore: don't wait with the PCATCH flag
  
  Due to the current synchronous xenstore implementation in FreeBSD, we
  cannot return from xs_read_reply without reading a reply, or else the
  ring gets out of sync and the next request will read the previous
  reply and crash due to the type mismatch. A proper solution involves
  making use of the req_id field in the message and allowing multiple
  in-flight messages at the same time on the ring.
  
  Remove the PCATCH flag so that signals don't interrupt the wait.
  
  Tested by:      Nathan Friess <nathan.friess at gmail.com>
  Sponsored by:   Citrix Systems R&D

Modified:
  head/sys/dev/xen/xenstore/xenstore.c

Modified: head/sys/dev/xen/xenstore/xenstore.c
==============================================================================
--- head/sys/dev/xen/xenstore/xenstore.c	Thu May 24 10:16:11 2018	(r334140)
+++ head/sys/dev/xen/xenstore/xenstore.c	Thu May 24 10:17:03 2018	(r334141)
@@ -742,8 +742,8 @@ xs_read_reply(enum xsd_sockmsg_type *type, u_int *len,
 
 	mtx_lock(&xs.reply_lock);
 	while (TAILQ_EMPTY(&xs.reply_list)) {
-		error = mtx_sleep(&xs.reply_list, &xs.reply_lock,
-		    PCATCH, "xswait", hz/10);
+		error = mtx_sleep(&xs.reply_list, &xs.reply_lock, 0, "xswait",
+		    hz/10);
 		if (error && error != EWOULDBLOCK) {
 			mtx_unlock(&xs.reply_lock);
 			return (error);


More information about the svn-src-head mailing list