Skip to contentSkip to conversation

master - snapshot: do not spawn when origin is not active

PATCH Zdenek Kabelac 1 participant 1 message Jun 17, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=15e7066fe3ea7ca9129b68e3b39e9667348a02cc
Commit:        15e7066fe3ea7ca9129b68e3b39e9667348a02cc
Parent:        c46d4a745dc8c5cb4cfc0c94863e555387e9af75
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Jun 16 12:43:22 2014 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Jun 17 13:36:07 2014 +0200

snapshot: do not spawn when origin is not active

Since the code is not doing anything when origin is not active, avoid spawning polling thread.

---
 tools/toollib.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/toollib.c +1 -1
index add20e3..c619d9b 100644
@@ -1455,7 +1455,7 @@ int lv_refresh(struct cmd_context *cmd, struct logical_volume *lv)
 	 * - fortunately: polldaemon will immediately shutdown if the
 	 *   origin doesn't have a status with a snapshot percentage
 	 */
-	if (background_polling() && lv_is_merging_origin(lv))
+	if (background_polling() && lv_is_merging_origin(lv) && lv_is_active_locally(lv))
 		lv_spawn_background_polling(cmd, lv);
 
 	return 1;