mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-03 17:47:44 +03:00
missing reply frees
This commit is contained in:
parent
598134b8e7
commit
1a002bbe59
19
lib/cache/lvmetad.c
vendored
19
lib/cache/lvmetad.c
vendored
@ -208,7 +208,7 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna
|
||||
log_error(INTERNAL_ERROR
|
||||
"We do not know the format (%s) reported by lvmetad.",
|
||||
fmt_name);
|
||||
return NULL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
fic.type = FMT_INSTANCE_MDAS | FMT_INSTANCE_AUX_MDAS;
|
||||
@ -216,7 +216,7 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna
|
||||
fic.context.vg_ref.vg_id = vgid;
|
||||
|
||||
if (!(fid = fmt->ops->create_instance(fmt, &fic)))
|
||||
return_NULL;
|
||||
goto_out;
|
||||
|
||||
if ((pvcn = dm_config_find_node(top, "metadata/physical_volumes")))
|
||||
for (pvcn = pvcn->child; pvcn; pvcn = pvcn->sib)
|
||||
@ -224,21 +224,25 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna
|
||||
|
||||
top->key = name;
|
||||
if (!(vg = import_vg_from_config_tree(reply.cft, fid)))
|
||||
return_NULL;
|
||||
goto_out;
|
||||
|
||||
dm_list_iterate_items(pvl, &vg->pvs) {
|
||||
if ((info = lvmcache_info_from_pvid((const char *)&pvl->pv->id, 0))) {
|
||||
pvl->pv->label_sector = lvmcache_get_label(info)->sector;
|
||||
pvl->pv->dev = lvmcache_device(info);
|
||||
if (!lvmcache_fid_add_mdas_pv(info, fid))
|
||||
return_NULL; /* FIXME error path */
|
||||
if (!lvmcache_fid_add_mdas_pv(info, fid)) {
|
||||
vg = NULL;
|
||||
goto_out; /* FIXME error path */
|
||||
}
|
||||
} /* else probably missing */
|
||||
}
|
||||
|
||||
lvmcache_update_vg(vg, 0);
|
||||
}
|
||||
|
||||
out:
|
||||
daemon_reply_destroy(reply);
|
||||
|
||||
return vg;
|
||||
}
|
||||
|
||||
@ -285,8 +289,7 @@ int lvmetad_vg_update(struct volume_group *vg)
|
||||
}
|
||||
|
||||
reply = daemon_send_simple(_lvmetad, "vg_update", "vgname = %s", vg->name,
|
||||
"metadata = %b", strchr(buf, '{'),
|
||||
NULL);
|
||||
"metadata = %b", strchr(buf, '{'), NULL);
|
||||
dm_free(buf);
|
||||
|
||||
if (!_lvmetad_handle_reply(reply, "update VG", vg->name, NULL)) {
|
||||
@ -294,6 +297,8 @@ int lvmetad_vg_update(struct volume_group *vg)
|
||||
return 0;
|
||||
}
|
||||
|
||||
daemon_reply_destroy(reply);
|
||||
|
||||
n = (vg->fid && vg->fid->metadata_areas_index) ?
|
||||
dm_hash_get_first(vg->fid->metadata_areas_index) : NULL;
|
||||
while (n) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user