1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-04-01 18:50:41 +03:00

lvconvert: delay archiving of metadata

Delay archiving of metadata until we really start to
update metadata when converting volume into a snapshot.
Archive is not necessary when we abort operation early.
This commit is contained in:
Zdenek Kabelac 2014-03-17 13:07:08 +01:00
parent d425e788e9
commit b738260c7c

View File

@ -2080,6 +2080,9 @@ static int _lvconvert_snapshot(struct cmd_context *cmd,
return 0;
}
if (!archive(lv->vg))
return_0;
if (!vg_add_snapshot(org, lv, NULL, org->le_count, lp->chunk_size)) {
log_error("Couldn't create snapshot.");
return 0;
@ -3040,9 +3043,6 @@ static int _lvconvert_single(struct cmd_context *cmd, struct logical_volume *lv,
log_error("Unable to convert mirrored LV \"%s\" into a snapshot.", lv->name);
return ECMD_FAILED;
}
if (!archive(lv->vg))
return_ECMD_FAILED;
if (!_lvconvert_snapshot(cmd, lv, lp))
return_ECMD_FAILED;