From owner-svn-src-stable@FreeBSD.ORG Wed Feb 29 18:42:00 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B0EC1065672; Wed, 29 Feb 2012 18:42:00 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 099448FC1A; Wed, 29 Feb 2012 18:42:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1TIfxMX039724; Wed, 29 Feb 2012 18:41:59 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1TIfx1r039722; Wed, 29 Feb 2012 18:41:59 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201202291841.q1TIfx1r039722@svn.freebsd.org> From: "Justin T. Gibbs" Date: Wed, 29 Feb 2012 18:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232310 - stable/9/sys/dev/xen/blkback X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Feb 2012 18:42:00 -0000 Author: gibbs Date: Wed Feb 29 18:41:59 2012 New Revision: 232310 URL: http://svn.freebsd.org/changeset/base/232310 Log: MFC r231883 =========== Fix regression in the handling of blkback close events for devices that are unplugged via QEMU. sys/dev/xen/blkback/blkback.c: Toolstack initiated closures change the frontend's state to Closing. The backend must change to Closing as well, even if we can't actually close yet, in order for the frontend to notice and start the closing process. Modified: stable/9/sys/dev/xen/blkback/blkback.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/xen/blkback/blkback.c ============================================================================== --- stable/9/sys/dev/xen/blkback/blkback.c Wed Feb 29 18:11:33 2012 (r232309) +++ stable/9/sys/dev/xen/blkback/blkback.c Wed Feb 29 18:41:59 2012 (r232310) @@ -3955,16 +3955,12 @@ xbb_frontend_changed(device_t dev, Xenbu xbb_connect(xbb); break; case XenbusStateClosing: - /* - * Frontend has acknowledged Closing request. - * Wait for Closed state. - */ - break; case XenbusStateClosed: mtx_lock(&xbb->lock); xbb_shutdown(xbb); mtx_unlock(&xbb->lock); - xenbus_set_state(xbb->dev, XenbusStateClosed); + if (frontend_state == XenbusStateClosed) + xenbus_set_state(xbb->dev, XenbusStateClosed); break; default: xenbus_dev_fatal(xbb->dev, EINVAL, "saw state %d at frontend",