mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 3 years ago
Clone

Blame SOURCES/lvm2-2_02_140-restore-background-polling-processing-during-auto-activation.patch

35a342
 WHATS_NEW        | 4 ++++
35a342
 tools/pvscan.c   | 9 +++++++++
35a342
 tools/tools.h    | 2 ++
35a342
 tools/vgchange.c | 4 ++--
35a342
 4 files changed, 17 insertions(+), 2 deletions(-)
35a342
35a342
diff --git a/WHATS_NEW b/WHATS_NEW
35a342
index 945b282..8c87a92 100644
35a342
--- a/WHATS_NEW
35a342
+++ b/WHATS_NEW
35a342
@@ -2,6 +2,10 @@ Version 2.02.142 -
35a342
 ====================================
35a342
   Do not check for suspended devices if scanning for lvmetad update.
35a342
 
35a342
+Version 2.02.140 -
35a342
+===================================
35a342
+  Restore background polling processing during auto-activation (2.02.119).
35a342
+
35a342
 Version 2.02.133 - 
35a342
 ======================================
35a342
   Check for enough space in thin-pool in command before creating new thin.
35a342
diff --git a/tools/pvscan.c b/tools/pvscan.c
35a342
index 3adb91c..b3b5911 100644
35a342
--- a/tools/pvscan.c
35a342
+++ b/tools/pvscan.c
35a342
@@ -154,6 +154,15 @@ static int _auto_activation_handler(struct cmd_context *cmd,
35a342
 		goto out;
35a342
 	}
35a342
 
35a342
+	/*
35a342
+	 * After sucessfull activation we need to initialise polling
35a342
+	 * for all activated LVs in a VG. Possible enhancement would
35a342
+	 * be adding --poll y|n cmdline option for pvscan and call
35a342
+	 * init_background_polling routine in autoactivation handler.
35a342
+	 */
35a342
+	if (!(vgchange_background_polling(vg->cmd, vg)))
35a342
+		goto_out;
35a342
+
35a342
 	r = 1;
35a342
 
35a342
 out:
35a342
diff --git a/tools/tools.h b/tools/tools.h
35a342
index 4ed893f..634b101 100644
35a342
--- a/tools/tools.h
35a342
+++ b/tools/tools.h
35a342
@@ -183,4 +183,6 @@ int mirror_remove_missing(struct cmd_context *cmd,
35a342
 int vgchange_activate(struct cmd_context *cmd, struct volume_group *vg,
35a342
 		       activation_change_t activate);
35a342
 
35a342
+int vgchange_background_polling(struct cmd_context *cmd, struct volume_group *vg);
35a342
+
35a342
 #endif
35a342
diff --git a/tools/vgchange.c b/tools/vgchange.c
35a342
index 1d3c64a..d572220 100644
35a342
--- a/tools/vgchange.c
35a342
+++ b/tools/vgchange.c
35a342
@@ -174,7 +174,7 @@ static int _vgchange_monitoring(struct cmd_context *cmd, struct volume_group *vg
35a342
 	return r;
35a342
 }
35a342
 
35a342
-static int _vgchange_background_polling(struct cmd_context *cmd, struct volume_group *vg)
35a342
+int vgchange_background_polling(struct cmd_context *cmd, struct volume_group *vg)
35a342
 {
35a342
 	int polled;
35a342
 
35a342
@@ -999,7 +999,7 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
35a342
 
35a342
 	if (!arg_count(cmd, refresh_ARG) &&
35a342
 	    background_polling())
35a342
-		if (!_vgchange_background_polling(cmd, vg))
35a342
+		if (!vgchange_background_polling(cmd, vg))
35a342
 			return_ECMD_FAILED;
35a342
 
35a342
 	if (arg_is_set(cmd, lockstart_ARG)) {