]> sourceware.org Git - lvm2.git/commitdiff
Found 2 problems with my previous check-in:
authorJonathan Earl Brassow <jbrassow@redhat.com>
Mon, 11 Jan 2010 17:13:45 +0000 (17:13 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Mon, 11 Jan 2010 17:13:45 +0000 (17:13 +0000)
 date: 2010/01/07 20:42:55;  author: jbrassow;  state: Exp;  lines: +11 -0
 The patch fixes some lvconvert issues (WRT mirror <-> mirror).

1) 'exisiting_mirrors' and 'lp->mirrors' where taken to be in 'n-1'
   notation (i.e a 2-way mirror is '1' and a linear is '0'), but the
   variables were in 'n' notation.
2) After adding the redundant mirror log support, I was calculating
   log_count by looking at the mirror log LV, but didn't take into
   account the fact that there could be no mirror log!

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
tools/lvconvert.c

index 1b73bad28d328e601c274a7473c5b3193779cf8b..2cee3927f5354b709c644d280129ff07e15c96c8 100644 (file)
@@ -668,10 +668,11 @@ static int _lvconvert_mirrors(struct cmd_context *cmd, struct logical_volume *lv
         * the type of log wasn't specified, then let's keep the log type
         * the same.
         */
-       if (existing_mirrors && lp->mirrors &&
-           (lp->mirrors != existing_mirrors) &&
+       if ((existing_mirrors > 1) && (lp->mirrors > 1) &&
+           (lp->mirrors != existing_mirrors) && !(lv->status & CONVERTING) &&
            !arg_count(cmd, mirrorlog_ARG) && !arg_count(cmd, corelog_ARG)) {
-               log_count = lv_mirror_count(first_seg(lv)->log_lv);
+               log_count = (first_seg(lv)->log_lv) ?
+                       lv_mirror_count(first_seg(lv)->log_lv) : 0;
        }
 
        if (repair) {
This page took 0.038938 seconds and 5 git commands to generate.