All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: lvm-devel@redhat.com
Subject: Don't allow resizing of internal logical volumes
Date: Fri, 19 Mar 2010 22:04:46 -0400	[thread overview]
Message-ID: <20100320020445.GA13275@redhat.com> (raw)
In-Reply-To: <20100319234417.GB31274@redhat.com>

On Fri, Mar 19 2010 at  7:44pm -0400,
Mike Snitzer <snitzer@redhat.com> wrote:

> On Fri, Mar 19 2010 at  6:27pm -0400,
> Mikulas Patocka <mpatocka@redhat.com> wrote:
> 
> > OK. It is cleaner than my patch that checks the name, so commit it (except 
> > !lv_is_accessible_hidden(lv), because that has to wait until we commit 
> > shared snapshots).
> > 
> > I tested it and it refuses "snapshotX" volumes.
> 
> But as you said above: "snapshot0 volumes have the VISIBLE_LV flag set."
> 
> That said, I do see that in practice the existing lvm2 code does reject
> resizing "snapshot" type snapshot0 using !lv_is_visible(lv).  I'll have
> a closer look to understand that.

lv_is_visible() prevents resize on "snapshot" type snapshot0 because of
this out: (lv->status & SNAPSHOT)

As you suggested, I'll commit the lv_is_visible() change to tools/lvresize.c

> But when I tried it with the "multisnapshot" type snapshot0 (w/
> multisnap enabled LVM2 2.02.63 from my people page + the above patch)
> lvresize allowed it and then crashed in _setup_alloced_segment():

I've added the same out in lv_is_accessible_hidden() and this prevents
the "multisnapshot" type snapshot0 from being resized:

int lv_is_accessible_hidden(const struct logical_volume *lv)
{
        if (lv->status & SNAPSHOT)
                return 0;

        if (lv_is_cow(lv))
                return (find_cow(lv)->lv->status & ACCESS_HIDDEN_LV) ? 1 : 0;

        return (lv->status & ACCESS_HIDDEN_LV) ? 1 : 0;
}




      reply	other threads:[~2010-03-20  2:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18 23:53 [PAYCH] Don't allow resizing of internal logical volumes Mikulas Patocka
2010-03-19 20:08 ` Mike Snitzer
2010-03-19 21:06   ` Alasdair G Kergon
2010-03-19 22:27   ` Mikulas Patocka
2010-03-19 23:44     ` Mike Snitzer
2010-03-20  2:04       ` Mike Snitzer [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=20100320020445.GA13275@redhat.com \
    --to=snitzer@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.