From: David Teigland <teigland@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] lvconvert: limit lv types for cache use
Date: Wed, 3 Sep 2014 10:30:43 -0500 [thread overview]
Message-ID: <20140903153043.GB20852@redhat.com> (raw)
In-Reply-To: <5406DC10.9020108@redhat.com>
On Wed, Sep 03, 2014 at 11:14:56AM +0200, Zdenek Kabelac wrote:
> >+#define lv_is_really_mirror_type(lv) (lv_is_mirror_type((lv)) && !lv_is_raid((lv)))
> >+
>
> In fact - there should be rather fixed the problem of using mirror_type for
> raids. These to targets are quite different and should not share internal
> flags - since it leads to many other internal bugs where code tries to
> run mirror repair operations on raid devices.
>
> So instead we should separate and fix usage of lv_is_mirror_type purely for
> old mirrors to avoid confusion.
Yeah, I went down that path... until it became too big a mess to untangle
right now. So this is a temporary solution.
> > /* Test if given LV is visible from user's perspective */
> > int lv_is_visible(const struct logical_volume *lv);
> >+int lv_is_invisible(const struct logical_volume *lv);
>
> !lv_is_visible is common way for code - so I would avoid to add
> new func for this.
Yeah, I had that... until ls_is_name had to report the inverse which was
more offensive than this addition.
> >+static const char *lv_is_name(struct logical_volume *lv)
> >+{
> >+ if (lv_is_external_origin(lv))
> >+ return "external_origin";
> >+
>
> There is already a reporting function for this with new Petr's patches.
Yeah, I looked at that, but it was not evident how to use it here, or if
it would really report what we needed here. I'd be happy if someone
replaced this with something better.
> >+ if (lv_is_external_origin(metadata_lv) ||
> >+ lv_is_thin_type(metadata_lv) ||
> >+ lv_is_external_origin(metadata_lv) ||
> >+ lv_is_really_mirror_type(metadata_lv) ||
> >+ lv_is_raid_image(metadata_lv) ||
> >+ lv_is_raid_metadata(metadata_lv) ||
> >+ lv_is_cache_type(metadata_lv) ||
> >+ lv_is_virtual(metadata_lv) ||
>
> Many of those types are already skipped because they are invisible.
> So I think this list should be much shorter.
Probably, but redundant checks are safer than missing some.
> >@@ -2716,12 +2824,6 @@ static int _lvconvert_pool(struct cmd_context *cmd,
> > display_lvname(metadata_lv));
> > return 0;
> > }
> >- if (lv_is_thin_type(metadata_lv) ||
> >- lv_is_cache_type(metadata_lv)) {
> >- log_error("Can't use thin or cache type LV %s for pool metadata.",
> >- display_lvname(metadata_lv));
> >- return 0;
> >- }
>
> don't remove
Hm, those should be included in the new combined check... will verify that.
> >- if (!lv_is_visible(pool_lv)) {
> >- log_error("Can't convert internal LV %s.", display_lvname(pool_lv));
> >- return 0;
> >- }
> >-
> >- if (lv_is_mirrored(pool_lv) && !lv_is_raid_type(pool_lv)) {
> >- log_error("Mirror logical volumes cannot be used as pools.\n"
> >- "Try \"raid1\" segment type instead.");
> >- return 0;
> >- }
> >-
>
> Don't remove
same
> >- if (lv_is_pool(origin) || lv_is_cache_type(origin)) {
> >- log_error("Can't cache pool or cache type volume %s.",
> >- display_lvname(origin));
>
> don't remove
same
prev parent reply other threads:[~2014-09-03 15:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 20:56 [PATCH] lvconvert: limit lv types for cache use David Teigland
2014-09-03 9:14 ` Zdenek Kabelac
2014-09-03 10:21 ` Peter Rajnoha
2014-09-03 15:30 ` David Teigland [this message]
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=20140903153043.GB20852@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.