diff options
author | Alasdair Kergon <agk@redhat.com> | 2007-11-07 16:33:12 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2007-11-07 16:33:12 +0000 |
commit | 19c865437a8c661045e61389dd6953047e2b9c82 (patch) | |
tree | 99b5b699a5c743ba37bb3b25a0b8252a2f74457f /lib/metadata/snapshot_manip.c | |
parent | 00a7c302ead32c0c38b7204db183d1b4388067dd (diff) | |
download | lvm2-19c865437a8c661045e61389dd6953047e2b9c82.tar.gz lvm2-19c865437a8c661045e61389dd6953047e2b9c82.tar.xz lvm2-19c865437a8c661045e61389dd6953047e2b9c82.zip |
Prevent lvconvert -s from using same LV as origin and snapshot.
Diffstat (limited to 'lib/metadata/snapshot_manip.c')
-rw-r--r-- | lib/metadata/snapshot_manip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c index 9e84a2a0..aab85ef7 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c @@ -63,6 +63,11 @@ int vg_add_snapshot(const char *name, struct logical_volume *origin, 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))) { |