summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2012-09-10 17:15:20 -0500
committerJonathan Brassow <jbrassow@redhat.com>2012-09-10 17:15:20 -0500
commitcdb0339319c89b8d1e5611537e9775a8c3ce5844 (patch)
tree16c2baba387d4b8fffe94c4cd03580917188b47e
parentb49b98d50c558a142d0a2ef55279eea00bd36eba (diff)
downloadlvm2-cdb0339319c89b8d1e5611537e9775a8c3ce5844.tar.gz
lvm2-cdb0339319c89b8d1e5611537e9775a8c3ce5844.tar.xz
lvm2-cdb0339319c89b8d1e5611537e9775a8c3ce5844.zip
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.
-rw-r--r--lib/metadata/raid_manip.c4
1 files changed, 4 insertions, 0 deletions
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)) {