From: Shaohua Li Date: Thu, 19 Jul 2012 10:49:56 +0000 (+1000) Subject: block: stack unplug X-Git-Tag: next-20120724~52^2~17 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=747d8879acc8ff4ac1b8a3937144d18b3d91af0c;p=karo-tx-linux.git 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 Signed-off-by: NeilBrown --- diff --git a/block/blk-core.c b/block/blk-core.c index 7296d3d8dca3..bf38a5b7dd0e 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -2900,17 +2900,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); + } } }