Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

NeilBrown cc13b1d1 d1db0eea

+7 -6
+7 -6
drivers/md/raid10.c
··· 1172 1172 int max_sectors; 1173 1173 int sectors; 1174 1174 1175 + /* 1176 + * Register the new request and wait if the reconstruction 1177 + * thread has put up a bar for new requests. 1178 + * Continue immediately if no resync is active currently. 1179 + */ 1180 + wait_barrier(conf); 1181 + 1175 1182 sectors = bio_sectors(bio); 1176 1183 while (test_bit(MD_RECOVERY_RESHAPE, &mddev->recovery) && 1177 1184 bio->bi_iter.bi_sector < conf->reshape_progress && ··· 1559 1552 1560 1553 md_write_start(mddev, bio); 1561 1554 1562 - /* 1563 - * Register the new request and wait if the reconstruction 1564 - * thread has put up a bar for new requests. 1565 - * Continue immediately if no resync is active currently. 1566 - */ 1567 - wait_barrier(conf); 1568 1555 1569 1556 do { 1570 1557