pr_err("No active reshape to revert on %s\n",
devname);
else if (sb->delta_disks == 0)
- pr_err("%s: Can on revert reshape which changes number of devices\n",
+ pr_err("%s: Can only revert reshape which changes number of devices\n",
devname);
else {
int tmp;
+ int parity = sb->level == 6 ? 2 : 1;
rv = 0;
+
+ if (sb->level >= 4 && sb->level <= 6 &&
+ 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 and stop again\n");
+ return -2;
+ }
sb->raid_disks -= sb->delta_disks;
sb->delta_disks = -sb->delta_disks;
"%d terabytes per device\n", tbmax);
return 0;
}
- if (chunk && *chunk == UnSet)
+ if (*chunk == UnSet)
*chunk = DEFAULT_CHUNK;
if (!subdev)