Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Feb 2012 18:41:59 +0000 (UTC)
From:      "Justin T. Gibbs" <gibbs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r232310 - stable/9/sys/dev/xen/blkback
Message-ID:  <201202291841.q1TIfx1r039722@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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",



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202291841.q1TIfx1r039722>