1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Properly release VG memory pool in archiver code.

This commit is contained in:
Milan Broz 2009-04-10 10:00:37 +00:00
parent 095bbca691
commit fc310448c0
2 changed files with 10 additions and 5 deletions

View File

@ -326,7 +326,7 @@ static void _display_archive(struct cmd_context *cmd, struct archive_file *af)
log_print("Description:\t%s", desc ? : "<No description>"); log_print("Description:\t%s", desc ? : "<No description>");
log_print("Backup Time:\t%s", ctime(&when)); log_print("Backup Time:\t%s", ctime(&when));
dm_pool_free(cmd->mem, vg); vg_release(vg);
tf->fmt->ops->destroy_instance(tf); tf->fmt->ops->destroy_instance(tf);
} }

View File

@ -326,6 +326,7 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
const char *file) const char *file)
{ {
struct volume_group *vg; struct volume_group *vg;
int r = 0;
/* /*
* Read in the volume group from the text file. * Read in the volume group from the text file.
@ -336,10 +337,11 @@ int backup_restore_from_file(struct cmd_context *cmd, const char *vg_name,
/* /*
* If PV is missing, there is already message from read above * If PV is missing, there is already message from read above
*/ */
if (vg_missing_pv_count(vg)) if (!vg_missing_pv_count(vg))
return_0; r = backup_restore_vg(cmd, vg);
return backup_restore_vg(cmd, vg); vg_release(vg);
return r;
} }
int backup_restore(struct cmd_context *cmd, const char *vg_name) int backup_restore(struct cmd_context *cmd, const char *vg_name)
@ -414,12 +416,15 @@ void check_current_backup(struct volume_group *vg)
(vg->seqno == vg_backup->seqno) && (vg->seqno == vg_backup->seqno) &&
(id_equal(&vg->id, &vg_backup->id))) { (id_equal(&vg->id, &vg_backup->id))) {
log_suppress(old_suppress); log_suppress(old_suppress);
vg_release(vg_backup);
return; return;
} }
log_suppress(old_suppress); log_suppress(old_suppress);
if (vg_backup) if (vg_backup) {
archive(vg_backup); archive(vg_backup);
vg_release(vg_backup);
}
archive(vg); archive(vg);
backup(vg); backup(vg);
} }