aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2013-08-27 01:57:47 -0400
committerNeilBrown <neilb@suse.de>2013-08-28 02:58:44 -0400
commit4d77e3ba88d085836f1e8e475e3131844dd89d04 (patch)
treea99d40da2a8f0bbfa69ca1d9b41728b8857fe0c6 /drivers/md/raid5.c
parentc46501b2deaa06efcaaf82917281941f02c6b307 (diff)
md/raid5: flush out all pending requests before proceeding with reshape.
Some requests - particularly 'discard' and 'read' are handled differently depending on whether a reshape is active or not. It is harmless to assume reshape is active if it isn't but wrong to act as though reshape is not active when it is. So when we start reshape - after making clear to all requests that reshape has started - use mddev_suspend/mddev_resume to flush out all requests. This will ensure that no requests will be assuming the absence of reshape once it really starts. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 4263df11d597..663a8e58d439 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -6279,6 +6279,13 @@ static int raid5_start_reshape(struct mddev *mddev)
6279 write_seqcount_end(&conf->gen_lock); 6279 write_seqcount_end(&conf->gen_lock);
6280 spin_unlock_irq(&conf->device_lock); 6280 spin_unlock_irq(&conf->device_lock);
6281 6281
6282 /* Now make sure any requests that proceeded on the assumption
6283 * the reshape wasn't running - like Discard or Read - have
6284 * completed.
6285 */
6286 mddev_suspend(mddev);
6287 mddev_resume(mddev);
6288
6282 /* Add some new drives, as many as will fit. 6289 /* Add some new drives, as many as will fit.
6283 * We know there are enough to make the newly sized array work. 6290 * We know there are enough to make the newly sized array work.
6284 * Don't add devices if we are reducing the number of 6291 * Don't add devices if we are reducing the number of