Blame SOURCES/0002-Merge-master-up-to-commit-be61bd6ff5c6.patch

aa5752
From f540a18fd7f5f65599a6c85c0bd3ba84e54f1cc8 Mon Sep 17 00:00:00 2001
aa5752
From: Marian Csontos <mcsontos@redhat.com>
aa5752
Date: Thu, 28 May 2020 18:02:16 +0200
aa5752
Subject: [PATCH] Merge master up to commit be61bd6ff5c6
aa5752
aa5752
---
aa5752
 VERSION                           |  2 +-
aa5752
 VERSION_DM                        |  2 +-
aa5752
 test/shell/cache-single-usage.sh  | 13 +++++++++++++
aa5752
 test/shell/integrity-dmeventd.sh  |  8 ++++++++
aa5752
 test/shell/integrity-large.sh     |  8 ++++++++
aa5752
 test/shell/integrity-misc.sh      |  8 ++++++++
aa5752
 test/shell/integrity.sh           |  8 ++++++++
aa5752
 test/shell/thin-foreign-repair.sh | 14 ++++++++++----
aa5752
 tools/lvconvert.c                 | 15 +++++++++++++++
aa5752
 9 files changed, 72 insertions(+), 6 deletions(-)
aa5752
aa5752
diff --git a/VERSION b/VERSION
aa5752
index 00618e0..9ad7a70 100644
aa5752
--- a/VERSION
aa5752
+++ b/VERSION
aa5752
@@ -1 +1 @@
aa5752
-2.03.09(2)-RHEL8 (2020-04-21)
aa5752
+2.03.09(2)-RHEL8 (2020-05-28)
aa5752
diff --git a/VERSION_DM b/VERSION_DM
aa5752
index b9ec43e..bcd97de 100644
aa5752
--- a/VERSION_DM
aa5752
+++ b/VERSION_DM
aa5752
@@ -1 +1 @@
aa5752
-1.02.171-RHEL8 (2020-04-21)
aa5752
+1.02.171-RHEL8 (2020-05-28)
aa5752
diff --git a/test/shell/cache-single-usage.sh b/test/shell/cache-single-usage.sh
aa5752
index a885bf7..8936aa3 100644
aa5752
--- a/test/shell/cache-single-usage.sh
aa5752
+++ b/test/shell/cache-single-usage.sh
aa5752
@@ -127,4 +127,17 @@ umount "$mount_dir"
aa5752
 lvchange -an $vg/$lv1
aa5752
 lvchange -an $vg/$lv2
aa5752
 
aa5752
+# misc tests
aa5752
+
aa5752
+lvremove $vg
aa5752
+
aa5752
+lvcreate -n $lv1 -l 2 -an $vg "$dev1"
aa5752
+lvcreate -n $lv2 -l 2 -an $vg "$dev1"
aa5752
+lvcreate -n $lv3 -l 2 -an $vg "$dev2"
aa5752
+
aa5752
+lvconvert -y --type writecache --cachevol $lv3 $vg/$lv1
aa5752
+not lvconvert -y --type writecache --cachevol ${lv3}_cvol $vg/$lv2
aa5752
+not lvconvert -y --type cache --cachevol ${lv3}_cvol $vg/$lv2
aa5752
+not lvconvert -y --type cache --cachepool ${lv3}_cvol $vg/$lv2
aa5752
+
aa5752
 vgremove -ff $vg
aa5752
diff --git a/test/shell/integrity-dmeventd.sh b/test/shell/integrity-dmeventd.sh
aa5752
index ed2436a..296f556 100644
aa5752
--- a/test/shell/integrity-dmeventd.sh
aa5752
+++ b/test/shell/integrity-dmeventd.sh
aa5752
@@ -109,6 +109,14 @@ _wait_recalc() {
aa5752
 		sleep 1
aa5752
 	done
aa5752
 
aa5752
+	# TODO: There is some strange bug, first leg of RAID with integrity
aa5752
+	# enabled never gets in sync. I saw this in BB, but not when executing
aa5752
+	# the commands manually
aa5752
+	if test -z "$sync"; then
aa5752
+		echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
aa5752
+                dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
aa5752
+		exit
aa5752
+	fi
aa5752
 	echo "timeout waiting for recalc"
aa5752
 	return 1
aa5752
 }
aa5752
diff --git a/test/shell/integrity-large.sh b/test/shell/integrity-large.sh
aa5752
index 7a333c1..5aba80e 100644
aa5752
--- a/test/shell/integrity-large.sh
aa5752
+++ b/test/shell/integrity-large.sh
aa5752
@@ -95,6 +95,14 @@ _wait_recalc() {
aa5752
 		sleep 1
aa5752
 	done
aa5752
 
aa5752
+	# TODO: There is some strange bug, first leg of RAID with integrity
aa5752
+	# enabled never gets in sync. I saw this in BB, but not when executing
aa5752
+	# the commands manually
aa5752
+	if test -z "$sync"; then
aa5752
+		echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
aa5752
+                dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
aa5752
+		exit
aa5752
+	fi
aa5752
 	echo "timeout waiting for recalc"
aa5752
 	return 1
aa5752
 }
aa5752
diff --git a/test/shell/integrity-misc.sh b/test/shell/integrity-misc.sh
aa5752
index a176f18..0d05689 100644
aa5752
--- a/test/shell/integrity-misc.sh
aa5752
+++ b/test/shell/integrity-misc.sh
aa5752
@@ -109,6 +109,14 @@ _wait_recalc() {
aa5752
 		sleep 1
aa5752
 	done
aa5752
 
aa5752
+	# TODO: There is some strange bug, first leg of RAID with integrity
aa5752
+	# enabled never gets in sync. I saw this in BB, but not when executing
aa5752
+	# the commands manually
aa5752
+	if test -z "$sync"; then
aa5752
+		echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
aa5752
+                dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
aa5752
+		exit
aa5752
+	fi
aa5752
 	echo "timeout waiting for recalc"
aa5752
 	return 1
aa5752
 }
aa5752
diff --git a/test/shell/integrity.sh b/test/shell/integrity.sh
aa5752
index 6baccf0..77e9430 100644
aa5752
--- a/test/shell/integrity.sh
aa5752
+++ b/test/shell/integrity.sh
aa5752
@@ -204,6 +204,14 @@ _wait_recalc() {
aa5752
 		sleep 1
aa5752
 	done
aa5752
 
aa5752
+	# TODO: There is some strange bug, first leg of RAID with integrity
aa5752
+	# enabled never gets in sync. I saw this in BB, but not when executing
aa5752
+	# the commands manually
aa5752
+	if test -z "$sync"; then
aa5752
+		echo "TEST WARNING: Resync of dm-integrity device '$checklv' failed"
aa5752
+                dmsetup status "$DM_DEV_DIR/mapper/${checklv/\//-}"
aa5752
+		exit
aa5752
+	fi
aa5752
 	echo "timeout waiting for recalc"
aa5752
 	return 1
aa5752
 }
aa5752
diff --git a/test/shell/thin-foreign-repair.sh b/test/shell/thin-foreign-repair.sh
aa5752
index 8b4018e..55e9f62 100644
aa5752
--- a/test/shell/thin-foreign-repair.sh
aa5752
+++ b/test/shell/thin-foreign-repair.sh
aa5752
@@ -17,9 +17,15 @@ SKIP_WITH_LVMPOLLD=1
aa5752
 
aa5752
 . lib/inittest
aa5752
 
aa5752
+clean_thin_()
aa5752
+{
aa5752
+	aux udev_wait
aa5752
+	dmsetup remove "$THIN" || { sleep .5 ; dmsetup remove "$THIN" ; }
aa5752
+}
aa5752
+
aa5752
 cleanup_mounted_and_teardown()
aa5752
 {
aa5752
-	dmsetup remove $THIN || true
aa5752
+	clean_thin_ || true
aa5752
 	vgremove -ff $vg
aa5752
 	aux teardown
aa5752
 }
aa5752
@@ -56,9 +62,7 @@ dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
aa5752
 
aa5752
 mkfs.ext4 "$DM_DEV_DIR/mapper/$THIN"
aa5752
 
aa5752
-aux udev_wait
aa5752
-
aa5752
-dmsetup remove "$THIN" || { sleep .5 ; dmsetup remove "$THIN" }
aa5752
+clean_thin_
aa5752
 
aa5752
 lvchange -an $vg/pool
aa5752
 
aa5752
@@ -72,3 +76,5 @@ lvchange -ay $vg/pool
aa5752
 dmsetup create "$THIN" --table "0 40960 thin $DM_DEV_DIR/mapper/$POOL 0"
aa5752
 
aa5752
 fsck -n "$DM_DEV_DIR/mapper/$THIN"
aa5752
+
aa5752
+# exit calls cleanup_mounted_and_teardown
aa5752
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
aa5752
index cf93538..8652252 100644
aa5752
--- a/tools/lvconvert.c
aa5752
+++ b/tools/lvconvert.c
aa5752
@@ -4264,6 +4264,11 @@ static int _lvconvert_cachevol_attach_single(struct cmd_context *cmd,
aa5752
 		goto out;
aa5752
 	}
aa5752
 
aa5752
+	if (lv_is_cache_vol(cachevol_lv)) {
aa5752
+		log_error("LV %s is already used as a cachevol.", display_lvname(cachevol_lv));
aa5752
+		goto out;
aa5752
+	}
aa5752
+
aa5752
 	/* Ensure the LV is not active elsewhere. */
aa5752
 	if (!lockd_lv(cmd, lv, "ex", 0))
aa5752
 		goto_out;
aa5752
@@ -4347,6 +4352,11 @@ static int _lvconvert_cachepool_attach_single(struct cmd_context *cmd,
aa5752
 			goto out;
aa5752
 		}
aa5752
 
aa5752
+		if (lv_is_cache_vol(cachepool_lv)) {
aa5752
+			log_error("LV %s is already used as a cachevol.", display_lvname(cachepool_lv));
aa5752
+			goto out;
aa5752
+		}
aa5752
+
aa5752
 		if (cachepool_lv == lv) {
aa5752
 			log_error("Use a different LV for cache pool LV and cache LV %s.",
aa5752
 				  display_lvname(cachepool_lv));
aa5752
@@ -5629,6 +5639,11 @@ static int _lvconvert_writecache_attach_single(struct cmd_context *cmd,
aa5752
 		goto bad;
aa5752
 	}
aa5752
 
aa5752
+	if (lv_is_cache_vol(lv_fast)) {
aa5752
+		log_error("LV %s is already used as a cachevol.", display_lvname(lv_fast));
aa5752
+		goto bad;
aa5752
+	}
aa5752
+
aa5752
 	/*
aa5752
 	 * To permit this we need to check the block size of the fs using lv
aa5752
 	 * (recently in libblkid) so that we can use a matching writecache
aa5752
-- 
aa5752
1.8.3.1
aa5752