1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

RAID: '--test' should not cause a valid create command to fail

It is necessary when creating a RAID LV to clear the new metadata areas.
Failure to do so could result in a prepopulated bitmap that would cause
the new array to skip syncing portions of the array.  It is a requirement
that the metadata LVs be activated and cleared in the process of creating.
However in test mode, this requirement should be lifted - no new LVs should
be created or written to.
This commit is contained in:
Jonathan Brassow 2012-09-05 14:32:06 -05:00
parent c3eb3a7687
commit b49b98d50c
3 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.98 -
=================================
Fix RAID LV creation with '--test' so valid commands do not fail.
Add lvm_lv_rename() to lvm2api.
Fix setvbuf code by closing and reopening stream before changing buffer.
Disable private buffering when using liblvm.

View File

@ -2623,6 +2623,12 @@ static int _lv_extend_layered_lv(struct alloc_handle *ah,
for (s = 0; s < seg->area_count; s++) {
meta_lv = seg_metalv(seg, s);
if (test_mode()) {
lv_set_hidden(meta_lv);
continue;
}
if (!activate_lv(meta_lv->vg->cmd, meta_lv)) {
log_error("Failed to activate %s/%s for clearing",
meta_lv->vg->name, meta_lv->name);

View File

@ -304,6 +304,9 @@ static int _clear_lv(struct logical_volume *lv)
{
int was_active = lv_is_active(lv);
if (test_mode())
return 1;
if (!was_active && !activate_lv(lv->vg->cmd, lv)) {
log_error("Failed to activate %s for clearing",
lv->name);