[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lvm2-commits
Subject:    =?utf-8?q?=5Blvm2-commits=5D?= master - lvconvert: enable --uncache with dm-writecache cachevol
From:       David Teigland <teigland () sourceware ! org>
Date:       2019-09-24 20:56:41
Message-ID: 20190924205641.19627594FF5A9 () mailman01 ! phx2 ! fedoraproject ! org
[Download RAW message or body]

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9a8e6ad014c7dd6785ad6859551d68a264bad1f8
Commit:        9a8e6ad014c7dd6785ad6859551d68a264bad1f8
Parent:        26596ce7faf1cd8b0aa4b199fa917fb14eace666
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Tue Sep 24 15:49:21 2019 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Tue Sep 24 15:51:05 2019 -0500

lvconvert: enable --uncache with dm-writecache cachevol

splitcache followed by an automatic lvremove of
the cachevol LV
---
 tools/lvconvert.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 07b5d6a..60ab956 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -4715,17 +4715,17 @@ static int _lvconvert_split_cache_single(struct cmd_context *cmd,
 
 	/* If LV is inactive here, ensure it's not active elsewhere. */
 	if (!lockd_lv(cmd, lv_main, "ex", 0))
-		return_0;
+		return ECMD_FAILED;
 
 	if (lv_is_writecache(lv_main)) {
+		if (!_lvconvert_detach_writecache(cmd, lv_main, lv_fast))
+			return ECMD_FAILED;
+
 		if (cmd->command->command_enum == lvconvert_split_and_remove_cache_CMD) {
-			log_error("Detach cache from %s with --splitcache.", display_lvname(lv));
-			log_error("The writecache %s may then be removed with lvremove.", display_lvname(lv_fast));
-			return 0;
+			if (lvremove_single(cmd, lv_fast, NULL) != ECMD_PROCESSED)
+				return ECMD_FAILED;
 		}
 
-		ret = _lvconvert_detach_writecache(cmd, lv_main, lv_fast);
-
 	} else if (lv_is_cache(lv_main) && lv_is_cache_vol(lv_fast)) {
 		if (cmd->command->command_enum == lvconvert_split_and_remove_cache_CMD) {
 			ret = _lvconvert_split_and_remove_cachevol(cmd, lv_main, lv_fast);
_______________________________________________
lvm2-commits mailing list -- lvm2-commits@lists.fedorahosted.org
To unsubscribe send an email to lvm2-commits-leave@lists.fedorahosted.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedorahosted.org/archives/list/lvm2-commits@lists.fedorahosted.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic