md: fix a potential deadlock of raid5/raid10 reshape
[sfrench/cifs-2.6.git] / drivers / md / raid5.c
index e3b0f799fbfae4cf985e421161002227d13bfd47..b5d2601483e34fa97fc8cfb7faeff6f014c0e035 100644 (file)
@@ -8000,13 +8000,7 @@ static void raid5_finish_reshape(struct mddev *mddev)
 
        if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
 
-               if (mddev->delta_disks > 0) {
-                       md_set_array_sectors(mddev, raid5_size(mddev, 0, 0));
-                       if (mddev->queue) {
-                               set_capacity(mddev->gendisk, mddev->array_sectors);
-                               revalidate_disk(mddev->gendisk);
-                       }
-               } else {
+               if (mddev->delta_disks <= 0) {
                        int d;
                        spin_lock_irq(&conf->device_lock);
                        mddev->degraded = raid5_calc_degraded(conf);