stable-2.02 - lvconvert: no validation for thin-pools not used by lvm2

Zdenek Kabelac <[email protected]>
Newsgroups dev.linux.lists.lvm-devel
Message-ID <[email protected]>
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1316cafbe988307264e4f87dbcffaf56bc2ab388
Commit:        1316cafbe988307264e4f87dbcffaf56bc2ab388
Parent:        5f766b32cf0d88644232a43a59247476a16fbc9c
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Apr 8 11:46:42 2020 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Wed Apr 8 15:31:17 2020 +0200

lvconvert: no validation for thin-pools not used by lvm2

lvm2 supports thin-pool to be later used by other tools doing
virtual volumes themself (i.e. docker) - in this case we
shall not validate transaction Id - is this is used by
other tools and lvm2 keeps value 0 - so the transationId
validation need to be skipped in this case.
---
 tools/lvconvert.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 677bed134..0bc1a0128 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2325,7 +2325,8 @@ static int _lvconvert_thin_pool_repair(struct cmd_context *cmd,
 		goto deactivate_mlv;
 	}
 
-	if (thin_dump[0]) {
+	/* Check matching transactionId when thin-pool is used by lvm2 (transactionId != 0) */
+	if (first_seg(pool_lv)->transaction_id && thin_dump[0]) {
 		argv[0] = thin_dump;
 		argv[1] = pms_path;
 		argv[2] = NULL;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.