mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 3 years ago
Clone

Blame SOURCES/lvm2-2_02_181-lvconvert-reject-conversions-of-LVs-under-snapshot.patch

5e29a5
 tools/lvconvert.c | 6 ++++++
5e29a5
 1 file changed, 6 insertions(+)
5e29a5
5e29a5
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
5e29a5
index 3ce228f..3fad02c 100644
5e29a5
--- a/tools/lvconvert.c
5e29a5
+++ b/tools/lvconvert.c
5e29a5
@@ -4256,6 +4256,12 @@ static int _lvconvert_to_pool_or_swap_metadata_single(struct cmd_context *cmd,
5e29a5
 		return 0;
5e29a5
 	};
5e29a5
 
5e29a5
+	if (lv_is_origin(lv)) {
5e29a5
+		log_error("Cannot convert logical volume %s under snapshot.",
5e29a5
+			  display_lvname(lv));
5e29a5
+		return 0;
5e29a5
+	};
5e29a5
+
5e29a5
 	if (cmd->position_argc > 1) {
5e29a5
 		/* First pos arg is required LV, remaining are optional PVs. */
5e29a5
 		if (!(use_pvh = create_pv_list(cmd->mem, lv->vg, cmd->position_argc - 1, cmd->position_argv + 1, 0)))