md/raid10: call wait_barrier() for each request submitted.
authorNeilBrown <neilb@suse.de>
Mon, 5 May 2014 03:34:37 +0000 (13:34 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 5 May 2014 23:49:26 +0000 (09:49 +1000)
commitcc13b1d1500656a20e41960668f3392dda9fa6e2
treef8a493446041e96f6c518aaaaac1551b781c0b57
parentd1db0eea852497762cab43b905b879dfcd3b8987
md/raid10: call wait_barrier() for each request submitted.

wait_barrier() includes a counter, so we must call it precisely once
(unless balanced by allow_barrier()) for each request submitted.

Since
commit 20d0189b1012a37d2533a87fb451f7852f2418d1
    block: Introduce new bio_split()
in 3.14-rc1, we don't call it for the extra requests generated when
we need to split a bio.

When this happens the counter goes negative, any resync/recovery will
never start, and  "mdadm --stop" will hang.

Reported-by: Chris Murphy <lists@colorremedies.com>
Fixes: 20d0189b1012a37d2533a87fb451f7852f2418d1
Cc: stable@vger.kernel.org (3.14+)
Cc: Kent Overstreet <kmo@daterainc.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid10.c