1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvconvert: snapshot: allow using raid1 for snapshot and snapshot origin

When testing conversion sanity, we checked lv->status & MIRRORED
which encompasses both old mirrors and raid1 mirrors. But we need to
ban only the old mirrors here hence allow raid1 mirrors.
This commit is contained in:
Peter Rajnoha 2014-08-20 10:05:51 +02:00
parent 4f05e55f84
commit 8d00499167
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.110 -
==================================
Allow conversion of raid1 LV into a snapshot LV or snapshot origin LV.
Cleanly error when creating RAID with stripe size < PAGE_SIZE.
Print name of LV which on activation triggers delayed snapshot merge.
Add lv_layout and lv_type LV reporting fields.

View File

@ -2041,7 +2041,7 @@ static int _lvconvert_snapshot(struct cmd_context *cmd,
{
struct logical_volume *org;
if (lv->status & MIRRORED) {
if ((lv->status & MIRRORED) && !lv_is_raid(lv)) {
log_error("Unable to convert mirrored LV \"%s\" into a snapshot.", lv->name);
return 0;
}
@ -2066,7 +2066,9 @@ static int _lvconvert_snapshot(struct cmd_context *cmd,
if (!cow_has_min_chunks(lv->vg, lv->le_count, lp->chunk_size))
return_0;
if (org->status & (LOCKED|PVMOVE|MIRRORED) || lv_is_cow(org)) {
if ((org->status & (LOCKED|PVMOVE)) ||
((org->status & MIRRORED) && !lv_is_raid(org)) ||
lv_is_cow(org)) {
log_error("Unable to convert an LV into a snapshot of a %s LV.",
org->status & LOCKED ? "locked" :
org->status & PVMOVE ? "pvmove" :