From: NeilBrown Date: Tue, 26 Oct 2010 06:41:22 +0000 (+1100) Subject: md/raid1: perform mem allocation before disabling writes during resync. X-Git-Tag: upstream/snapshot3+hdmi~12585^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1c4588e9c19cae6209a28c9da2f16a18a610b935;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git md/raid1: perform mem allocation before disabling writes during resync. Though this mem alloc is GFP_NOIO an so will not deadlock, it seems better to do the allocation before 'raise_barrier' which stops any IO requests while the resync proceeds. raid10 always uses this order, so it is at least consistent to do the same in raid1. Signed-off-by: NeilBrown --- diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 40f58d3..6cb6cae 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -1749,11 +1749,11 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i msleep_interruptible(1000); bitmap_cond_end_sync(mddev->bitmap, sector_nr); + r1_bio = mempool_alloc(conf->r1buf_pool, GFP_NOIO); raise_barrier(conf); conf->next_resync = sector_nr; - r1_bio = mempool_alloc(conf->r1buf_pool, GFP_NOIO); rcu_read_lock(); /* * If we get a correctably read error during resync or recovery,