]> sourceware.org Git - lvm2.git/commitdiff
raid: fix mirror image naming when converting from mirror to raid1
authorHeinz Mauelshagen <heinzm@redhat.com>
Wed, 7 Jan 2015 12:25:08 +0000 (13:25 +0100)
committerPeter Rajnoha <prajnoha@redhat.com>
Wed, 7 Jan 2015 12:25:08 +0000 (13:25 +0100)
$ 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

lib/metadata/raid_manip.c

index 59d3adb88f4362a70d7c84abe07975f04942072a..6f951f4b8bfb16e5f58076563095ef381c4d63b7 100644 (file)
@@ -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;
This page took 0.039843 seconds and 5 git commands to generate.