(md: Online Capacity Expansion for IMSM) When sum of added disks and degraded disks is greater than max_degraded number, reshape decides that stripe is broken, so bio i/o error is a result. Added disks without data has no impact on volume degradation (contains no data so far), so we have to be sure that all disks used to reshape has In_sync flag set. We have to do this for disks without data. --- drivers/md/raid5.c | 17 ++++++++++++++++- 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index dc25a32..cb74045 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5468,7 +5468,7 @@ static int raid5_start_reshape(mddev_t *mddev) /* Add some new drives, as many as will fit. * We know there are enough to make the newly sized array work. */ - list_for_each_entry(rdev, &mddev->disks, same_set) + list_for_each_entry(rdev, &mddev->disks, same_set) { if (rdev->raid_disk < 0 && !test_bit(Faulty, &rdev->flags)) { if (raid5_add_disk(mddev, rdev) == 0) { @@ -5488,6 +5488,21 @@ static int raid5_start_reshape(mddev_t *mddev) } else break; } + /* if there is Online Capacity Expansion + * on degraded array for external meta + */ + if (mddev->external && + (conf->raid_disks <= (disk_count + conf->max_degraded))) { + /* check if not spare */ + if (!(rdev->raid_disk < 0 && + !test_bit(Faulty, &rdev->flags))) + /* make sure that all disks, + * even added previously have + * in sync flag set + */ + set_bit(In_sync, &rdev->flags); + } + } /* When a reshape changes the number of devices, ->degraded * is measured against the large of the pre and post number of ��.n��������+%������w��{.n�����{����w��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f