From owner-svn-src-head@freebsd.org Thu May 24 10:17:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57FB5EAAD76; Thu, 24 May 2018 10:17:04 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0E281C02; Thu, 24 May 2018 10:17:04 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E05FB10E72; Thu, 24 May 2018 10:17:03 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4OAH3nc076628; Thu, 24 May 2018 10:17:03 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4OAH3Dt076627; Thu, 24 May 2018 10:17:03 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201805241017.w4OAH3Dt076627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 24 May 2018 10:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334141 - head/sys/dev/xen/xenstore X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/dev/xen/xenstore X-SVN-Commit-Revision: 334141 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2018 10:17:04 -0000 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 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);