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

[lvm-devel] [PATCH lvconvert 10/11] Warn if lvconvert needs activation to complete conversion



lvconvert requires activation of the LV, when it adds mirrors to
already mirrored LV. The patch makes it to print a message when
the LV was not activated.
(Alternative may force activation on lvconvert.)

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
If the converted LV is not active, starting polldaemon makes no sense.
Rather, it should be warned that activation is needed.

Index: LVM2.work/tools/lvconvert.c
===================================================================
--- LVM2.work.orig/tools/lvconvert.c
+++ LVM2.work/tools/lvconvert.c
@@ -706,6 +706,7 @@ int lvconvert(struct cmd_context * cmd, 
 	struct lv_list *lvl;
 	struct lvconvert_params lp;
 	int ret = ECMD_FAILED;
+	struct lvinfo info;
 
 	if (!_read_params(&lp, cmd, argc, argv)) {
 		stack;
@@ -739,8 +740,14 @@ int lvconvert(struct cmd_context * cmd, 
 error:
 	unlock_vg(cmd, lp.vg_name);
 
-	if (ret == ECMD_PROCESSED && lp.wait_daemon)
+	if (ret == ECMD_PROCESSED && lp.wait_daemon) {
+		if (!lv_info(cmd, lvl->lv, &info, 1, 0) || !info.exists) {
+			log_print("Conversion starts after activation");
+			return ret;
+		}
 		ret = _lvconvert_poll(cmd, lp.lv_name_full,
 				      arg_count(cmd, background_ARG) ? 1U : 0);
+	}
+
 	return ret;
 }

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