summaryrefslogtreecommitdiff
path: root/super0.c
diff options
context:
space:
mode:
Diffstat (limited to 'super0.c')
-rw-r--r--super0.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/super0.c b/super0.c
index ff4c657c..b2019dfa 100644
--- a/super0.c
+++ b/super0.c
@@ -654,7 +654,16 @@ static int update_super0(struct supertype *st, struct mdinfo *info,
devname);
else {
int tmp;
+ int parity = sb->level == 6 ? 2 : 1;
rv = 0;
+
+ if (sb->reshape_position % (
+ sb->new_chunk/512 *
+ (sb->raid_disks - sb->delta_disks - parity))) {
+ pr_err("Reshape position is not suitably aligned.\n");
+ pr_err("Try normal assembly as stop again\n");
+ return -2;
+ }
sb->raid_disks -= sb->delta_disks;
sb->delta_disks = -sb->delta_disks;