1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

Found 2 problems with my previous check-in:

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>
This commit is contained in:
Jonathan Earl Brassow 2010-01-11 17:13:45 +00:00
parent 0878503f0f
commit 68427c03e9

View 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) {