aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-raid.c
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2017-07-13 11:36:12 -0400
committerMike Snitzer <snitzer@redhat.com>2017-07-25 14:54:19 -0400
commitf4af3f82daed14ea06ac22eac198a45f56eb2cb1 (patch)
tree9e35952fdd9a1dedb4e9ff0083b1f85a77da3f40 /drivers/md/dm-raid.c
parentbbac1e06a415c0658dd328ba9c5f640c2d97be3a (diff)
dm raid: fix activation check in validate_raid_redundancy()
During growing reshapes (i.e. stripes being added to a raid set), the new stripe images are not in-sync and not part of the raid set until the reshape is started. LVM2 has to request multiple table reloads involving superblock updates in order to reflect proper size of SubLVs in the cluster. Before a stripe adding reshape starts, validate_raid_redundancy() fails as a result of that because it checks the total number of devices against the number of rebuild ones rather than the actual ones in the raid set (as retrieved from the superblock) thus resulting in failed raid4/5/6/10 redundancy checks. E.g. convert 3 stripes -> 7 stripes raid5 (which only allows for maximum 1 device to fail) requesting +4 delta disks causing 4 devices to rebuild during reshaping thus failing activation. To fix this, move validate_raid_redundancy() to get access to the current raid_set members. Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md/dm-raid.c')
-rw-r--r--drivers/md/dm-raid.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index b409015c6909..c256a723b964 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -2541,11 +2541,6 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
2541 if (!freshest) 2541 if (!freshest)
2542 return 0; 2542 return 0;
2543 2543
2544 if (validate_raid_redundancy(rs)) {
2545 rs->ti->error = "Insufficient redundancy to activate array";
2546 return -EINVAL;
2547 }
2548
2549 /* 2544 /*
2550 * Validation of the freshest device provides the source of 2545 * Validation of the freshest device provides the source of
2551 * validation for the remaining devices. 2546 * validation for the remaining devices.
@@ -2554,6 +2549,11 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
2554 if (super_validate(rs, freshest)) 2549 if (super_validate(rs, freshest))
2555 return -EINVAL; 2550 return -EINVAL;
2556 2551
2552 if (validate_raid_redundancy(rs)) {
2553 rs->ti->error = "Insufficient redundancy to activate array";
2554 return -EINVAL;
2555 }
2556
2557 rdev_for_each(rdev, mddev) 2557 rdev_for_each(rdev, mddev)
2558 if (!test_bit(Journal, &rdev->flags) && 2558 if (!test_bit(Journal, &rdev->flags) &&
2559 rdev != freshest && 2559 rdev != freshest &&