Skip to content

Commit

Permalink
md/raid5: release/flush io in raid5_do_work()
Browse files Browse the repository at this point in the history
commit 9c72a18 upstream.

In raid5, there are scenarios where some ios are deferred to a later
time, and some IO need a flush to complete. To make sure we make
progress with these IOs, we need to call the following functions:

    flush_deferred_bios(conf);
    r5l_flush_stripe_to_raid(conf->log);

Both of these functions are called in raid5d(), but missing in
raid5_do_work(). As a result, these functions are not called
when multi-threading (group_thread_cnt > 0) is enabled. This patch
adds calls to these function to raid5_do_work().

Note for stable branches:

  r5l_flush_stripe_to_raid(conf->log) is need for 4.4+
  flush_deferred_bios(conf) is only needed for 4.11+

Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
liu-song-6 authored and gregkh committed Sep 27, 2017
1 parent e21d660 commit d5c59ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -5822,6 +5822,8 @@ static void raid5_do_work(struct work_struct *work)

spin_unlock_irq(&conf->device_lock);

r5l_flush_stripe_to_raid(conf->log);

async_tx_issue_pending_all();
blk_finish_plug(&plug);

Expand Down

0 comments on commit d5c59ee

Please sign in to comment.