aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2007-02-28 23:11:48 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-01 17:53:36 -0500
commitb4c4c7b8095298ff4ce20b40bf180ada070812d0 (patch)
tree2c51fe8ef220be17c791f8aca1218cadcae22b7f /drivers/md/raid5.c
parentd1b5380c7f794da16e815c34e54ee7641db8a288 (diff)
[PATCH] md: restart a (raid5) reshape that has been aborted due to a read/write error
An error always aborts any resync/recovery/reshape on the understanding that it will immediately be restarted if that still makes sense. However a reshape currently doesn't get restarted. With this patch it does. To avoid restarting when it is not possible to do work, we call into the personality to check that a reshape is ok, and strengthen raid5_check_reshape to fail if there are too many failed devices. We also break some code out into a separate function: remove_and_add_spares as the indent level for that code was getting crazy. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 11c3d7bfa797..29fc06b47d4e 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3814,6 +3814,8 @@ static int raid5_check_reshape(mddev_t *mddev)
3814 if (err) 3814 if (err)
3815 return err; 3815 return err;
3816 3816
3817 if (mddev->degraded > conf->max_degraded)
3818 return -EINVAL;
3817 /* looks like we might be able to manage this */ 3819 /* looks like we might be able to manage this */
3818 return 0; 3820 return 0;
3819} 3821}