[lvm-devel] master - cache: enforce local exlusive activation

Zdenek Kabelac zkabelac at fedoraproject.org
Tue Apr 1 19:30:37 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c2876ee1c9086bd4c0a8e898e05919cfcb6aded7
Commit:        c2876ee1c9086bd4c0a8e898e05919cfcb6aded7
Parent:        c95d43b28c5f89e1d96f2b16805ecd74eb4b02fb
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Tue Apr 1 21:29:28 2014 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Tue Apr 1 21:29:28 2014 +0200

cache: enforce local exlusive activation

For cache flushing local exlusive activation is needed.
---
 lib/metadata/cache_manip.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c
index b71e9e0..9a055e8 100644
--- a/lib/metadata/cache_manip.c
+++ b/lib/metadata/cache_manip.c
@@ -191,8 +191,9 @@ int lv_cache_remove(struct logical_volume *cache_lv)
 	}
 
 	/* Active volume is needed (writeback only?) */
-	if (!activate_lv(cache_lv->vg->cmd, cache_lv)) {
-		log_error("Failed to active cache %s.", cache_lv->name);
+	if (!lv_is_active_locally(cache_lv) &&
+	    !activate_lv_excl_local(cache_lv->vg->cmd, cache_lv)) {
+		log_error("Failed to active cache locally %s.", cache_lv->name);
 		return 0;
 	}
 




More information about the lvm-devel mailing list