[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH lvconvert] Check if polling is needed if the number of mirrors is specified



lvconvert restarts the polling of the conversion check
if no action is specified.

It should behave in the same manner if the number of mirrors given
by '-m' is the same as it has.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
If 'lvconvert -m<n> <lv>' is executed for <n + 1>-way mirror,
the command has nothing to do until 2.02.29.
Since 2.02.30, the lv might possibly be under the convesion status.
So lvconvert has to check it and start polling if necessary.

<Create a 2-way mirror, adding the 3rd mirror image>
# lvconvert -m+1 vg/lvol0
<Ctrl-c> to stop polling
# lvconvert -m2 vg/lvol0
  Logical volume lvol0 already has 2 mirror(s).
  vg/lvol0: Converted: 100.0%
  Logical volume lvol0 converted.
# lvconvert -m2 vg/lvol0
  Logical volume lvol0 already has 2 mirror(s).
<Immediately returns>

Index: LVM2.work/tools/lvconvert.c
===================================================================
--- LVM2.work.orig/tools/lvconvert.c
+++ LVM2.work/tools/lvconvert.c
@@ -526,6 +526,8 @@ static int lvconvert_mirrors(struct cmd_
 			log_error("Logical volume %s already has %"
 				  PRIu32 " mirror(s).", lv->name,
 				  lp->mirrors - 1);
+			if (lv->status & CONVERTING)
+				lp->need_polling = 1;
 			return 1;
 		}
 	} else if (lp->mirrors > existing_mirrors) {

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]