Skip to content

Commit

Permalink
block: stack unplug
Browse files Browse the repository at this point in the history
MD raid1 prepares to dispatch request in unplug callback. If make_request in
low level queue also uses unplug callback to dispatch request, the low level
queue's unplug callback will not be called. Recheck the callback list helps
this case.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Shaohua Li authored and Jens Axboe committed Jul 31, 2012
1 parent 9cbb175 commit 2a7d555
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2913,17 +2913,16 @@ static void flush_plug_callbacks(struct blk_plug *plug)
{
LIST_HEAD(callbacks);

if (list_empty(&plug->cb_list))
return;

list_splice_init(&plug->cb_list, &callbacks);
while (!list_empty(&plug->cb_list)) {
list_splice_init(&plug->cb_list, &callbacks);

while (!list_empty(&callbacks)) {
struct blk_plug_cb *cb = list_first_entry(&callbacks,
while (!list_empty(&callbacks)) {
struct blk_plug_cb *cb = list_first_entry(&callbacks,
struct blk_plug_cb,
list);
list_del(&cb->list);
cb->callback(cb);
list_del(&cb->list);
cb->callback(cb);
}
}
}

Expand Down

0 comments on commit 2a7d555

Please sign in to comment.