Skip to contentSkip to conversation

master - thin: improve pool creation activation order

PATCH Zdenek Kabelac 1 participant 1 message Jul 18, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=08df7ba844f837c4a09540feadaa734d7f3259f8
Commit:        08df7ba844f837c4a09540feadaa734d7f3259f8
Parent:        4e724f5f52e3f641d1ccc5a90d0af2ad73a52a8d
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Jul 18 16:44:39 2013 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Thu Jul 18 18:22:43 2013 +0200

thin: improve pool creation activation order

Pool creation involves clearing of metadata device which triggers udev watch rule we cannot udev synchronize with in current code.

This metadata devices needs to be activated localy, so in cluster mode deactivation and reactivation is always needed.

However for non-clustered mode we may reload table via suspend/resume path which avoids collision with udev watch rule which was occasionaly triggering retry deactivation loop.

Code has been also split into 2 separate code paths for thin pools and thin volumes which improved readability of the code as well.

Deactivation has been moved out of extend_pool() and decision is now in _lv_create_an_lv() which knows the change mode.

---
 WHATS_NEW                 |    1 +
 lib/metadata/lv_manip.c   |   57 +++++++++++++++++++++++++++++++++++++--------
 lib/metadata/thin_manip.c |    8 +-----
 3 files changed, 49 insertions(+), 17 deletions(-)
WHATS_NEW +1 -0
index f49c71c..f9cfa01 100644
@@ -1,5 +1,6 @@
 Version 2.02.99 - 
 ===================================
+  Improve activation order when creating thin pools in non-clustered VG.
   List thin-pool and thin modules for thin volumes.
   Correct thin creation error paths.
   Use local activation for clearing snapshot COW device.
lib/metadata/lv_manip.c +47 -10

84 lines not on this page · raw message

lib/metadata/thin_manip.c +1 -7
index 8724845..adb0a25 100644
@@ -473,13 +473,7 @@ int extend_pool(struct logical_volume *pool_lv, const struct segment_type *segty
 		    !set_lv(pool_lv->vg->cmd, pool_lv, UINT64_C(0), 0)) {
 			log_error("Aborting. Failed to wipe pool metadata %s.",
 				  pool_lv->name);
-			return 0;
-		}
-
-		if (!deactivate_lv_local(pool_lv->vg->cmd, pool_lv)) {
-			log_error("Aborting. Could not deactivate pool metadata %s.",
-				  pool_lv->name);
-			return 0;
+			goto bad;
 		}
 	} else {
 		log_warn("WARNING: Pool %s is created without initialization.", pool_lv->name);