diff options
author | Clark Williams <williams@redhat.com> | 2012-04-04 10:52:26 -0500 |
---|---|---|
committer | Clark Williams <williams@redhat.com> | 2012-04-04 10:52:26 -0500 |
commit | 2d93eaf2d4ace5853a74a4b0596f601aa62cb840 (patch) | |
tree | b0a2e2083c1749c4e3b8ae23db7bb13a7ca9aafe /drivers/md/raid10.c | |
parent | 003133585fc61d7bd36d3a097d7fde62e64a9550 (diff) | |
parent | 23d8c3f8f494c8516c9b4c05529e118e6a485956 (diff) |
Merge commit 'v3.2.14' into rt-3.2.14-rt23v3.2.14-rt23
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 685ddf325ee4..b2194494f5f3 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c @@ -790,9 +790,22 @@ static void wait_barrier(struct r10conf *conf) spin_lock_irq(&conf->resync_lock); if (conf->barrier) { conf->nr_waiting++; - wait_event_lock_irq(conf->wait_barrier, !conf->barrier, + /* Wait for the barrier to drop. + * However if there are already pending + * requests (preventing the barrier from + * rising completely), and the + * pre-process bio queue isn't empty, + * then don't wait, as we need to empty + * that queue to get the nr_pending + * count down. + */ + wait_event_lock_irq(conf->wait_barrier, + !conf->barrier || + (conf->nr_pending && + current->bio_list && + !bio_list_empty(current->bio_list)), conf->resync_lock, - ); + ); conf->nr_waiting--; } conf->nr_pending++; |