From: Dave Wysochanski Date: Fri, 9 Jul 2010 16:57:44 +0000 (+0000) Subject: Add log_error when strdup fails in {vg|lv}_change_tag(). X-Git-Tag: v2_02_91~1693 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=f77fb62b2a729e56246a3ff6494ce0c3adbf5548;p=lvm2.git Add log_error when strdup fails in {vg|lv}_change_tag(). Signed-off-by: Dave Wysochanski --- diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index cded84985..07222a7cb 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -723,7 +723,9 @@ int lv_change_tag(struct logical_volume *lv, const char *tag, int add_tag) if (add_tag) { if (!(tag_new = dm_pool_strdup(lv->vg->vgmem, tag))) { - return_0; + log_error("Failed to duplicate tag %s from %s/%s", + tag, lv->vg->name, lv->name); + return 0; } if (!str_list_add(lv->vg->vgmem, &lv->tags, tag_new)) { log_error("Failed to add tag %s to %s/%s", @@ -751,7 +753,9 @@ int vg_change_tag(struct volume_group *vg, const char *tag, int add_tag) if (add_tag) { if (!(tag_new = dm_pool_strdup(vg->vgmem, tag))) { - return_0; + log_error("Failed to duplicate tag %s from %s", + tag, vg->name); + return 0; } if (!str_list_add(vg->vgmem, &vg->tags, tag_new)) { log_error("Failed to add tag %s to volume group %s",