summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2019-10-11 15:27:41 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2019-10-14 15:14:46 +0200
commitf6d171ffe33455ab48e142820aa74be901e8aee9 (patch)
treee54024506475b37903f87d4bbefd924723409131
parent615e18f5b2356bd1fd134bc24ea790fa6ec0653f (diff)
downloadlvm2-f6d171ffe33455ab48e142820aa74be901e8aee9.tar.gz
cachevol: wipe 'normal' device
For wiping we activate and clear 'regular' devices, since in case of whole process interuption (i.e. kill -9) we leave metadata & DM table and workable state all the time.
-rw-r--r--WHATS_NEW1
-rw-r--r--tools/lvconvert.c8
2 files changed, 4 insertions, 5 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index bb806ac22..6405686eb 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.03.06 -
================================
+ Use normal LVs for wiping of cachevols.
Reload cleanered cache DM only with cleaner policy.
Fix cmd return when zering of cachevol fails.
Extend lvs to show all VDO properties.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 8ecbf3418..885380cf8 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4224,8 +4224,6 @@ static int _lvconvert_cachevol_attach_single(struct cmd_context *cmd,
if (!lockd_lv(cmd, cachevol_lv, "ex", LDLV_PERSISTENT))
goto_out;
- cachevol_lv->status |= LV_CACHE_VOL;
-
if (!wipe_cache_pool(cachevol_lv))
goto_out;
@@ -4240,7 +4238,7 @@ static int _lvconvert_cachevol_attach_single(struct cmd_context *cmd,
goto_out;
/* Attach the cache to the main LV. */
-
+ cachevol_lv->status |= LV_CACHE_VOL;
if (!_cache_vol_attach(cmd, lv, cachevol_lv))
goto_out;
@@ -5551,8 +5549,6 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd,
if (!archive(vg))
goto_bad;
- lv_fast->status |= LV_CACHE_VOL;
-
/*
* TODO: use libblkid to get the sector size of lv. If it doesn't
* match the block_size we are using for the writecache, then warn that
@@ -5567,6 +5563,8 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd,
return ECMD_FAILED;
}
+ lv_fast->status |= LV_CACHE_VOL;
+
/*
* Changes the vg struct to match the desired state.
*