[md PATCH 5/5] md: Fix: 'degraded' calculation when starting reshape for external metadata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



(md: Online Capacity Expansion for IMSM)
When reshape is about to start it checks if number of degraded disks after reshape is not greater than maximum degraded disks allowed for this array kind. Devices added to configuration by mdadm are not used for this calculation (but they have to).
We know that such disks has not set in_sync flag. We count all disks that has not set in_sync flag. This gives us number of disks added to configuration. Those disks are used degraded disks number calculation.
---

 drivers/md/raid5.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index cb74045..5c2292d 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5500,7 +5500,10 @@ static int raid5_start_reshape(mddev_t *mddev)
 				 * even added previously have
 				 * in sync flag set
 				 */
-				set_bit(In_sync, &rdev->flags);
+				if (!test_bit(In_sync, &rdev->flags)) {
+					set_bit(In_sync, &rdev->flags);
+					added_devices++;
+				}
 		}
 	}
 

��.n��������+%������w��{.n�����{����w��ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux