Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0b7335f84717743b…
Commit: 0b7335f84717743bf9c3f9ea9cafff279dff8672
Parent: 969ab6bbf02c11bf989ccc3105910a205448507b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Nov 2 17:48:21 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 3 14:19:33 2014 +0100
cache: allow deactivation of empty pool
Tool will use internal activation of unused cache pool to
clear metadata area before next use of cache-pool.
So allow to deactivation unused pool in case some error
case happend and we were not able to deactivation pool
right after metadata wipe.
---
tools/lvchange.c | 5 +----
tools/toollib.c | 17 +++++++++++++++++
tools/vgchange.c | 4 ----
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 6697905..99dba82 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2011 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2014 Red Hat, Inc. All rights reserved.
*
* This file is part of LVM2.
*
@@ -170,9 +170,6 @@ static int _lvchange_activate(struct cmd_context *cmd, struct logical_volume *lv
activate = (activation_change_t) arg_uint_value(cmd, activate_ARG, CHANGE_AY);
- if (lv_is_cache_pool(lv))
- return 1;
-
if (lv_activation_skip(lv, activate, arg_count(cmd, ignoreactivationskip_ARG)))
return 1;
diff --git a/tools/toollib.c b/tools/toollib.c
index e87fd30..0472597 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -688,6 +688,23 @@ int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
{
int r = 1;
+ if (lv_is_cache_pool(lv)) {
+ if (is_change_activating(activate)) {
+ log_verbose("Skipping activation of cache pool %s.",
+ display_lvname(lv));
+ return 1;
+ }
+ if (!dm_list_empty(&lv->segs_using_this_lv)) {
+ log_verbose("Skipping deactivation of used cache pool %s.",
+ display_lvname(lv));
+ return 1;
+ }
+ /*
+ * Allow to pass only deactivation of unused cache pool.
+ * Useful only for recovery of failed zeroing of metadata LV.
+ */
+ }
+
if (lv_is_merging_origin(lv)) {
/*
* For merging origin, its snapshot must be inactive.
diff --git a/tools/vgchange.c b/tools/vgchange.c
index af59f3a..e5d700d 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -97,10 +97,6 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, struct volume_group *vg,
if (!lv_is_visible(lv))
continue;
- /* Cache pool cannot be activated */
- if (lv_is_cache_pool(lv))
- continue;
-
/* If LV is sparse, activate origin instead */
if (lv_is_cow(lv) && lv_is_virtual_origin(origin_from_cow(lv)))
lv = origin_from_cow(lv);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=dc11dcf11d90f24c…
Commit: dc11dcf11d90f24c8d37988f3029e29cc6a45441
Parent: c1ee6d4ffc7d520e015a8e44f50392510fb85167
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Oct 31 20:25:25 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Nov 3 14:19:32 2014 +0100
filters: change return code
No data for writing should be seen as 'dump' success.
(reduces one <bactrace> in the log) - it has no other
effect.
---
lib/filters/filter-persistent.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/filters/filter-persistent.c b/lib/filters/filter-persistent.c
index 600fa38..3c1701b 100644
--- a/lib/filters/filter-persistent.c
+++ b/lib/filters/filter-persistent.c
@@ -193,7 +193,7 @@ static int _persistent_filter_dump(struct dev_filter *f, int merge_existing)
if (!dm_hash_get_num_entries(pf->devices)) {
log_very_verbose("Internal persistent device cache empty "
"- not writing to %s", pf->file);
- return 0;
+ return 1;
}
if (!dev_cache_has_scanned()) {
log_very_verbose("Device cache incomplete - not writing "