diff options
author | Shaohua Li <shli@kernel.org> | 2012-07-31 03:08:15 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-07-31 03:08:15 -0400 |
commit | 2a7d5559b346574057dce4672d1ed9aaa9d1e685 (patch) | |
tree | 55d611455d1ca07ed03b35a114350801c7865022 | |
parent | 9cbb17508808f8a6bdd83354b61e126ac4fa6fed (diff) |
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>
-rw-r--r-- | block/blk-core.c | 15 |
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) | |||
2913 | { | 2913 | { |
2914 | LIST_HEAD(callbacks); | 2914 | LIST_HEAD(callbacks); |
2915 | 2915 | ||
2916 | if (list_empty(&plug->cb_list)) | 2916 | while (!list_empty(&plug->cb_list)) { |
2917 | return; | 2917 | list_splice_init(&plug->cb_list, &callbacks); |
2918 | |||
2919 | list_splice_init(&plug->cb_list, &callbacks); | ||
2920 | 2918 | ||
2921 | while (!list_empty(&callbacks)) { | 2919 | while (!list_empty(&callbacks)) { |
2922 | struct blk_plug_cb *cb = list_first_entry(&callbacks, | 2920 | struct blk_plug_cb *cb = list_first_entry(&callbacks, |
2923 | struct blk_plug_cb, | 2921 | struct blk_plug_cb, |
2924 | list); | 2922 | list); |
2925 | list_del(&cb->list); | 2923 | list_del(&cb->list); |
2926 | cb->callback(cb); | 2924 | cb->callback(cb); |
2925 | } | ||
2927 | } | 2926 | } |
2928 | } | 2927 | } |
2929 | 2928 | ||