From cdb0339319c89b8d1e5611537e9775a8c3ce5844 Mon Sep 17 00:00:00 2001 From: Jonathan Brassow Date: Mon, 10 Sep 2012 17:15:20 -0500 Subject: RAID: Disallow addition of RAID images while array is not in-sync We cannot add images to a RAID array while it is not in-sync. The kernel will simply reject the table, saying: 'rebuild' specified while array is not in-sync Now we check to ensure the LV is in-sync before attempting image additions. --- lib/metadata/raid_manip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index b5552cb4..4eced6fb 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -663,6 +663,10 @@ static int _raid_add_images(struct logical_volume *lv, log_error("Unable to add RAID images to %s of segment type %s", lv->name, seg->segtype->ops->name(seg)); return 0; + } else if (!_raid_in_sync(lv)) { + log_error("Unable to add RAID images until %s is in-sync", + lv->name); + return 0; } if (!_alloc_image_components(lv, pvs, count, &meta_lvs, &data_lvs)) { -- cgit