Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311598
b: refs/heads/master
c: 458f27a
h: refs/heads/master
v: v3
  • Loading branch information
Asias He authored and Jens Axboe committed Jun 15, 2012
1 parent fd0a976 commit 18d37fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d407cfaf5a56b3030b9e55d0f542601e173c5d2
refs/heads/master: 458f27a9823a0841acb4ca59e0e7f33e181f85e2
15 changes: 14 additions & 1 deletion trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,10 @@ EXPORT_SYMBOL(blk_put_queue);
*/
void blk_drain_queue(struct request_queue *q, bool drain_all)
{
int i;

while (true) {
bool drain = false;
int i;

spin_lock_irq(q->queue_lock);

Expand Down Expand Up @@ -408,6 +409,18 @@ void blk_drain_queue(struct request_queue *q, bool drain_all)
break;
msleep(10);
}

/*
* With queue marked dead, any woken up waiter will fail the
* allocation path, so the wakeup chaining is lost and we're
* left with hung waiters. We need to wake up those waiters.
*/
if (q->request_fn) {
spin_lock_irq(q->queue_lock);
for (i = 0; i < ARRAY_SIZE(q->rq.wait); i++)
wake_up_all(&q->rq.wait[i]);
spin_unlock_irq(q->queue_lock);
}
}

/**
Expand Down

0 comments on commit 18d37fb

Please sign in to comment.