Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=5e88d3a89b353ad4d286d…
Commit: 5e88d3a89b353ad4d286d453dcc24042b09efaf9
Parent: 5b5c5cc618bbfaa2945d6fe2211443b28588764a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Nov 20 16:33:43 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 24 16:09:59 2017 +0100
cache: use conditional in warning message
In some cases the message could be slightly misleading so use
here rather conditional.
TODO:
In future we may possibly further tune the message in case we are
certain the level of redundancy protection has not been reduced.
---
lib/metadata/cache_manip.c | 2 +-
test/shell/lvconvert-cache-raid.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c
index 5e0e5c4..55ed724 100644
--- a/lib/metadata/cache_manip.c
+++ b/lib/metadata/cache_manip.c
@@ -129,7 +129,7 @@ void cache_check_for_warns(const struct lv_segment *seg)
if (lv_is_raid(origin_lv) &&
first_seg(seg->pool_lv)->cache_mode == CACHE_MODE_WRITEBACK)
- log_warn("WARNING: Data redundancy is lost with writeback "
+ log_warn("WARNING: Data redundancy could be lost with writeback "
"caching of raid logical volume!");
if (lv_is_thin_pool_data(seg->lv))
diff --git a/test/shell/lvconvert-cache-raid.sh b/test/shell/lvconvert-cache-raid.sh
index 9e4f55c..ec9b1e4 100644
--- a/test/shell/lvconvert-cache-raid.sh
+++ b/test/shell/lvconvert-cache-raid.sh
@@ -39,7 +39,7 @@ lvcreate --type raid1 -m 1 --nosync -l 2 -n $lv1 $vg
lvcreate --type raid1 -m 1 --nosync -l 2 -n ${lv1}_cachepool $vg
#should lvs -a $vg/${lv1}_cdata_rimage_0 # ensure images are properly renamed
lvconvert --yes --type cache --cachemode writeback --cachepool $vg/${lv1}_cachepool $vg/$lv1 2>&1 | tee out
-grep "WARNING: Data redundancy is lost" out
+grep "WARNING: Data redundancy could be lost" out
check lv_exists $vg/${lv1}_corig_rimage_0 # ensure images are properly renamed
dmsetup table ${vg}-$lv1 | grep cache # ensure it is loaded in kernel
lvremove -f $vg
@@ -47,7 +47,7 @@ lvremove -f $vg
lvcreate -n corigin -m 1 --type raid1 --nosync -l 10 $vg
lvcreate -n cpool --type cache $vg/corigin --cachemode writeback -l 10 2>&1 | tee out
-grep "WARNING: Data redundancy is lost" out
+grep "WARNING: Data redundancy could be lost" out
not lvconvert --splitmirrors 1 --name split $vg/corigin "$dev1"
lvconvert --yes --splitmirrors 1 --name split $vg/corigin "$dev1"
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=ddbe763eb81c5f9608ca9…
Commit: ddbe763eb81c5f9608ca9ff192bd33d9d37acd77
Parent: aa68b898ff9c51dcbd87c6be34632e33f0299a18
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Nov 24 13:58:23 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Nov 24 16:05:21 2017 +0100
mirror: use lv_update_and_reload_origin
Replace complex code with standard lv_update_and_reload_origin().
Extra suspend should not be necessary.
(If they would be - dependency tree would have bug for fixing).
---
lib/metadata/mirror.c | 44 +-------------------------------------------
1 files changed, 1 insertions(+), 43 deletions(-)
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index c89408c..327ce99 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -1038,50 +1038,8 @@ static int _remove_mirror_images(struct logical_volume *lv,
* remove the LVs from the mirror set, commit that metadata
* then deactivate and remove them fully.
*/
- if (!vg_write(mirrored_seg->lv->vg)) {
- log_error("intermediate VG write failed.");
- return 0;
- }
-
- if (!suspend_lv_origin(mirrored_seg->lv->vg->cmd, mirrored_seg->lv)) {
- log_error("Failed to lock %s.", display_lvname(mirrored_seg->lv));
- vg_revert(mirrored_seg->lv->vg);
- return 0;
- }
-
- /* FIXME: second suspend should not be needed
- * Explicitly suspend temporary LV.
- * This balances critical_section_inc() calls with critical_section_dec()
- * in resume (both local and cluster) and also properly propagates precommitted
- * metadata into dm table on other nodes.
- * FIXME: check propagation of suspend with visible flag
- */
- if (temp_layer_lv && !suspend_lv(temp_layer_lv->vg->cmd, temp_layer_lv))
- log_error("Problem suspending temporary LV %s.", display_lvname(temp_layer_lv));
-
- if (!vg_commit(mirrored_seg->lv->vg)) {
- if (!resume_lv(mirrored_seg->lv->vg->cmd, mirrored_seg->lv))
- stack;
+ if (!lv_update_and_reload_origin(mirrored_seg->lv))
return_0;
- }
-
- log_very_verbose("Updating %s in kernel.", display_lvname(mirrored_seg->lv));
-
- /*
- * Avoid having same mirror target loaded twice simultaneously by first
- * resuming the removed LV which now contains an error segment.
- * As it's now detached from mirrored_seg->lv we must resume it
- * explicitly.
- */
- if (temp_layer_lv && !resume_lv(temp_layer_lv->vg->cmd, temp_layer_lv)) {
- log_error("Problem resuming temporary LV %s.", display_lvname(temp_layer_lv));
- return 0;
- }
-
- if (!resume_lv_origin(mirrored_seg->lv->vg->cmd, mirrored_seg->lv)) {
- log_error("Problem reactivating %s.", display_lvname(mirrored_seg->lv));
- return 0;
- }
/* Save or delete the 'orphan' LVs */
reactivate = lv_is_active(lv_lock_holder(lv));