summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorShaohua Li <shli@kernel.org>2012-07-31 11:08:15 +0400
committerJens Axboe <axboe@kernel.dk>2012-07-31 11:08:15 +0400
commit2a7d5559b346574057dce4672d1ed9aaa9d1e685 (patch)
tree55d611455d1ca07ed03b35a114350801c7865022 /block
parent9cbb17508808f8a6bdd83354b61e126ac4fa6fed (diff)
downloadlinux-2a7d5559b346574057dce4672d1ed9aaa9d1e685.tar.xz
block: stack unplug
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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 177ddcf356e6..35bf4fe8234c 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -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);
+ }
}
}