All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vgchange: disallow clustered vg with thin or cache type
@ 2014-09-03 16:49 David Teigland
  0 siblings, 0 replies; only message in thread
From: David Teigland @ 2014-09-03 16:49 UTC (permalink / raw)
  To: lvm-devel

---
 tools/vgchange.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/vgchange.c b/tools/vgchange.c
index 88dc180798d2..770fac35ca55 100644
--- a/tools/vgchange.c
+++ b/tools/vgchange.c
@@ -304,6 +304,26 @@ static int _vgchange_clustered(struct cmd_context *cmd,
 			       struct volume_group *vg)
 {
 	int clustered = !strcmp(arg_str_value(cmd, clustered_ARG, "n"), "y");
+	struct lv_list *lvl;
+	struct logical_volume *lv;
+
+	if (clustered) {
+		dm_list_iterate_items(lvl, &vg->lvs) {
+			lv = lvl->lv;
+
+			if (lv_is_cache_type(lv)) {
+				log_error("Clustered VG is not supported with cache type LV %s",
+					  lv->name);
+				return 0;
+			}
+
+			if (lv_is_thin_type(lv)) {
+				log_error("Clustered VG is not supported with thin type LV %s",
+					  lv->name);
+				return 0;
+			}
+		}
+	}
 
 	if (clustered && (vg_is_clustered(vg))) {
 		log_error("Volume group \"%s\" is already clustered",
-- 
1.8.3.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-03 16:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-03 16:49 [PATCH] vgchange: disallow clustered vg with thin or cache type David Teigland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.