From: Mike Snitzer <snitzer@redhat.com>
To: benscott@nwlink.com
Cc: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] lvconvert --merge bug
Date: Sun, 17 Jul 2011 08:23:01 -0400 [thread overview]
Message-ID: <20110717122301.GB31728@redhat.com> (raw)
In-Reply-To: <201107162229.33740.benscott@nwlink.com>
On Sun, Jul 17 2011 at 1:29am -0400,
ben <benscott@nwlink.com> wrote:
> I was playing with snapshot merging a discovered a problem. If a snap starts
> out as invalid the merge command starts merging and then quits. That leaves
> the snap in a strange condition. It is listed as merging even though the merge
> failed. It also becomes tricky to delete the invalid snap. It would seem
> better if the merge command checked the validity first.
I agree that it should check for invalid, but looking at
tools/lvconvert.c:_lvconvert_single it clearly doesn't.
The code to check if a snapshot is invalid is a bit cumbersome (from
lib/metadata/lv.c:lv_attr_dup):
if (lv_info(lv->vg->cmd, lv, 0, &info, 1, 0) && info.exists) {
...
/* Snapshot dropped? */
if (info.live_table && lv_is_cow(lv) &&
(!lv_snapshot_percent(lv, &snap_percent) ||
snap_percent == PERCENT_INVALID)) {
repstr[0] = toupper(repstr[0]);
if (info.suspended)
repstr[4] = 'S'; /* Susp Inv snapshot */
else
repstr[4] = 'I'; /* Invalid snapshot */
}
Seems we don't have this check for invalid snapshot factored out for
lvconvert to easily consume.
Anyway, we just need to work through the proper fix. Thanks for
reporting the issue!
> I also have a question. The error message from lvconvert suggests that the
> snap might become invalid <during> the merge. If that happens does the origin
> get scrambled?
Can you please be more specific on which error message you're referring
to?
Thanks,
Mike
prev parent reply other threads:[~2011-07-17 12:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-17 5:29 [linux-lvm] lvconvert --merge bug ben
2011-07-17 12:23 ` 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=20110717122301.GB31728@redhat.com \
--to=snitzer@redhat.com \
--cc=benscott@nwlink.com \
--cc=linux-lvm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).