All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Teigland <teigland@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] lvconvert: require pool arg to match thin or cache
Date: Tue, 2 Sep 2014 16:35:12 -0500	[thread overview]
Message-ID: <20140902213512.GH374@redhat.com> (raw)

A --thinpool arg should not be a cache pool, and
a --cachepool arg should not be a thin pool.
---
 tools/lvconvert.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index ba7c4bad29b4..1e106cf3abf8 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -2867,6 +2867,16 @@ static int _lvconvert_pool(struct cmd_context *cmd,
 			return 0;
 		}
 
+		if (arg_str_value(cmd, cachepool_ARG, NULL) && lv_is_thin_pool(pool_lv)) {
+			log_error("Error: cachepool arg is a thin pool");
+			return 0;
+		}
+
+		if (arg_str_value(cmd, thinpool_ARG, NULL) && lv_is_cache_pool(pool_lv)) {
+			log_error("Error: thinpool arg is a cache pool");
+			return 0;
+		}
+
 		/* FIXME cache pool */
 		if (lv_is_thin_pool(pool_lv) && pool_is_active(pool_lv)) {
 			/* If any volume referencing pool active - abort here */
-- 
1.8.3.1



                 reply	other threads:[~2014-09-02 21:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140902213512.GH374@redhat.com \
    --to=teigland@redhat.com \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.