linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] lvconvert --merge bug
@ 2011-07-17  5:29 ben
  2011-07-17 12:23 ` Mike Snitzer
  0 siblings, 1 reply; 2+ messages in thread
From: ben @ 2011-07-17  5:29 UTC (permalink / raw)
  To: linux-lvm

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 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?

Thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] lvconvert --merge bug
  2011-07-17  5:29 [linux-lvm] lvconvert --merge bug ben
@ 2011-07-17 12:23 ` Mike Snitzer
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Snitzer @ 2011-07-17 12:23 UTC (permalink / raw)
  To: benscott; +Cc: LVM general discussion and development

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-17 12:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-17  5:29 [linux-lvm] lvconvert --merge bug ben
2011-07-17 12:23 ` Mike Snitzer

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).