mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-21 22:04:19 +03:00
raid: fix mirror image naming when converting from mirror to raid1
$ lvcreate -l1 -m1 --type mirror vg Logical volume "lvol0" created. $ lvconvert --type raid1 vg/lvol0 Before: $ lvs -a vg LV VG Active Attr LSize Cpy%Sync Layout Role lvol0 vg active rwi-a-r--- 4.00m 100.00 raid,raid1 public [lvol0_mimage_0_rimage_0] vg active iwi-aor--- 4.00m linear private,raid,image [lvol0_mimage_1_rimage_1] vg active iwi-aor--- 4.00m linear private,raid,image [lvol0_rmeta_0] vg active ewi-aor--- 4.00m linear private,raid,metadata [lvol0_rmeta_1] vg active ewi-aor--- 4.00m linear private,raid,metadata Incorrect name: lvol0_mimage_0_rimage_0 With this patch applied: $ lvs -a vg LV VG Active Attr LSize Cpy%Sync Layout Role lvol0 vg active rwi-a-r--- 4.00m 100.00 raid,raid1 public [lvol0_rimage_0] vg active iwi-aor--- 4.00m linear private,raid,image [lvol0_rimage_1] vg active iwi-aor--- 4.00m linear private,raid,image [lvol0_rmeta_0] vg active ewi-aor--- 4.00m linear private,raid,metadata [lvol0_rmeta_1] vg active ewi-aor--- 4.00m linear private,raid,metadata Proper name: lvol0_rimage_0
This commit is contained in:
parent
ff1eca3b6f
commit
aaecbb1818
@ -1409,7 +1409,7 @@ static int _convert_mirror_to_raid1(struct logical_volume *lv,
|
||||
}
|
||||
|
||||
for (s = 0; s < seg->area_count; ++s) {
|
||||
if (!(new_name = _generate_raid_name(seg_lv(seg, s), "rimage", s)))
|
||||
if (!(new_name = _generate_raid_name(lv, "rimage", s)))
|
||||
return_0;
|
||||
log_debug_metadata("Renaming %s to %s", seg_lv(seg, s)->name, new_name);
|
||||
seg_lv(seg, s)->name = new_name;
|
||||
|
Loading…
x
Reference in New Issue
Block a user