diff options
| author | Roger Pau Monné <royger@FreeBSD.org> | 2016-06-03 11:39:35 +0000 |
|---|---|---|
| committer | Roger Pau Monné <royger@FreeBSD.org> | 2016-06-03 11:39:35 +0000 |
| commit | 3e0522bc8f9a1b4011d7223100f0b85e7c97bb41 (patch) | |
| tree | 4eadf132375e2cd623ca0d1778eeefef3d57a9d2 /sys/dev/xen/blkback | |
| parent | de0bad00010c9e7e68c4ede0f415535abf8e7da3 (diff) | |
Notes
Diffstat (limited to 'sys/dev/xen/blkback')
| -rw-r--r-- | sys/dev/xen/blkback/blkback.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/xen/blkback/blkback.c b/sys/dev/xen/blkback/blkback.c index 6ca8c007614f..9c9735e5b24f 100644 --- a/sys/dev/xen/blkback/blkback.c +++ b/sys/dev/xen/blkback/blkback.c @@ -172,7 +172,6 @@ struct xbb_xen_req; static void xbb_attach_failed(struct xbb_softc *xbb, int err, const char *fmt, ...) __attribute__((format(printf, 3, 4))); static int xbb_shutdown(struct xbb_softc *xbb); -static int xbb_detach(device_t dev); /*------------------------------ Data Structures -----------------------------*/ @@ -3419,8 +3418,8 @@ xbb_shutdown(struct xbb_softc *xbb) mtx_lock(&xbb->lock); xbb->flags &= ~XBBF_IN_SHUTDOWN; - /* The front can submit I/O until entering the closed state. */ - if (frontState < XenbusStateClosed) + /* Wait for the frontend to disconnect (if it's connected). */ + if (frontState == XenbusStateConnected) return (EAGAIN); DPRINTF("\n"); @@ -3477,7 +3476,9 @@ xbb_attach_failed(struct xbb_softc *xbb, int err, const char *fmt, ...) xs_printf(XST_NIL, xenbus_get_node(xbb->dev), "online", "0"); - xbb_detach(xbb->dev); + mtx_lock(&xbb->lock); + xbb_shutdown(xbb); + mtx_unlock(&xbb->lock); } /*---------------------------- NewBus Entrypoints ----------------------------*/ |
