int done;
struct mdinfo *sra = NULL;
+ /* when reshaping a RAID0, the component_size might be zero.
+ * So try to fix that up.
+ */
+ if (ioctl(fd, GET_ARRAY_INFO, &array) != 0) {
+ dprintf("Cannot get array information.\n");
+ goto release;
+ }
+ if (array.level == 0 && info->component_size == 0) {
+ get_dev_size(fd, NULL, &array_size);
+ info->component_size = array_size / array.raid_disks;
+ }
+
if (info->reshape_active) {
int new_level = info->new_level;
info->new_level = UnSet;
" cannot continue.\n");
goto release;
}
- if (ioctl(fd, GET_ARRAY_INFO, &array) != 0) {
- dprintf("Cannot get array information.\n");
- goto release;
- }
if (restart) {
/* reshape already started. just skip to monitoring the reshape */