Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cdb0339319c89b8d1... Commit: cdb0339319c89b8d1e5611537e9775a8c3ce5844 Parent: b49b98d50c558a142d0a2ef55279eea00bd36eba Author: Jonathan Brassow jbrassow@redhat.com AuthorDate: Mon Sep 10 17:15:20 2012 -0500 Committer: Jonathan Brassow jbrassow@redhat.com CommitterDate: Mon Sep 10 17:15:20 2012 -0500
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 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index b5552cb..4eced6f 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)) {
lvm2-commits@lists.fedorahosted.org