Commit 015a2f82 authored by Jens Axboe's avatar Jens Axboe

Merge branch 'stable/for-jens-4.13' of...

Merge branch 'stable/for-jens-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen into for-linus

Pull xen-blkback fix from Konrad:

"[...] A bug-fix when shutting down xen block backend driver with
 multiple queues and the driver not clearing all of them."
parents 22d53821 dc52d783
...@@ -244,6 +244,7 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif) ...@@ -244,6 +244,7 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif)
{ {
struct pending_req *req, *n; struct pending_req *req, *n;
unsigned int j, r; unsigned int j, r;
bool busy = false;
for (r = 0; r < blkif->nr_rings; r++) { for (r = 0; r < blkif->nr_rings; r++) {
struct xen_blkif_ring *ring = &blkif->rings[r]; struct xen_blkif_ring *ring = &blkif->rings[r];
...@@ -261,8 +262,10 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif) ...@@ -261,8 +262,10 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif)
* don't have any discard_io or other_io requests. So, checking * don't have any discard_io or other_io requests. So, checking
* for inflight IO is enough. * for inflight IO is enough.
*/ */
if (atomic_read(&ring->inflight) > 0) if (atomic_read(&ring->inflight) > 0) {
return -EBUSY; busy = true;
continue;
}
if (ring->irq) { if (ring->irq) {
unbind_from_irqhandler(ring->irq, ring); unbind_from_irqhandler(ring->irq, ring);
...@@ -300,6 +303,9 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif) ...@@ -300,6 +303,9 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif)
WARN_ON(i != (XEN_BLKIF_REQS_PER_PAGE * blkif->nr_ring_pages)); WARN_ON(i != (XEN_BLKIF_REQS_PER_PAGE * blkif->nr_ring_pages));
ring->active = false; ring->active = false;
} }
if (busy)
return -EBUSY;
blkif->nr_ring_pages = 0; blkif->nr_ring_pages = 0;
/* /*
* blkif->rings was allocated in connect_ring, so we should free it in * blkif->rings was allocated in connect_ring, so we should free it in
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment