From: agk@sourceware.org <agk@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW lib/metadata/merge.c lib/meta ...
Date: 7 Nov 2007 16:33:12 -0000 [thread overview]
Message-ID: <20071107163312.31782.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk at sourceware.org 2007-11-07 16:33:12
Modified files:
. : WHATS_NEW
lib/metadata : merge.c snapshot_manip.c
tools : lvconvert.c
Log message:
Prevent lvconvert -s from using same LV as origin and snapshot.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.729&r2=1.730
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/snapshot_manip.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43
--- LVM2/WHATS_NEW 2007/11/05 17:17:55 1.729
+++ LVM2/WHATS_NEW 2007/11/07 16:33:11 1.730
@@ -1,5 +1,6 @@
Version 2.02.29 -
==================================
+ Prevent lvconvert -s from using same LV as origin and snapshot.
Fix human-readable output of odd numbers of sectors.
Add pv_mda_free and vg_mda_free fields to reports for raw text format.
Add LVM2 version to 'Generated by' comment in metadata.
--- LVM2/lib/metadata/merge.c 2007/08/20 20:55:26 1.29
+++ LVM2/lib/metadata/merge.c 2007/11/07 16:33:11 1.30
@@ -119,6 +119,15 @@
}
}
+ if (seg_is_snapshot(seg)) {
+ if (seg->cow && seg->cow == seg->origin) {
+ log_error("LV %s: segment %u has same LV %s for "
+ "both origin and snapshot",
+ lv->name, seg_count, seg->cow->name);
+ r = 0;
+ }
+ }
+
for (s = 0; s < seg->area_count; s++) {
if (seg_type(seg, s) == AREA_UNASSIGNED) {
log_error("LV %s: segment %u has unassigned "
--- LVM2/lib/metadata/snapshot_manip.c 2007/11/02 20:40:04 1.28
+++ LVM2/lib/metadata/snapshot_manip.c 2007/11/07 16:33:12 1.29
@@ -63,6 +63,11 @@
return 0;
}
+ if (cow == origin) {
+ log_error("Snapshot and origin LVs must differ.");
+ return 0;
+ }
+
if (!(snap = lv_create_empty(name ? name : "snapshot%d",
lvid, LVM_READ | LVM_WRITE | VISIBLE_LV,
ALLOC_INHERIT, 1, origin->vg))) {
--- LVM2/tools/lvconvert.c 2007/11/02 20:40:04 1.42
+++ LVM2/tools/lvconvert.c 2007/11/07 16:33:12 1.43
@@ -495,6 +495,12 @@
return 0;
}
+ if (org == lv) {
+ log_error("Unable to use \"%s\" as both snapshot and origin.",
+ lv->name);
+ return 0;
+ }
+
if (org->status & (LOCKED|PVMOVE) || lv_is_cow(org)) {
log_error("Unable to create a snapshot of a %s LV.",
org->status & LOCKED ? "locked" :
next reply other threads:[~2007-11-07 16:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-07 16:33 agk [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-03-31 12:06 LVM2 ./WHATS_NEW lib/metadata/merge.c lib/meta mpatocka
2010-05-21 12:43 zkabelac
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=20071107163312.31782.qmail@sourceware.org \
--to=agk@sourceware.org \
--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.