]> sourceware.org Git - lvm2.git/commitdiff
Add log_error when strdup fails in {vg|lv}_change_tag().
authorDave Wysochanski <dwysocha@redhat.com>
Fri, 9 Jul 2010 16:57:44 +0000 (16:57 +0000)
committerDave Wysochanski <dwysocha@redhat.com>
Fri, 9 Jul 2010 16:57:44 +0000 (16:57 +0000)
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
lib/metadata/metadata.c

index cded849853f624316da6ce8c7c27c5d9bca84619..07222a7cb53ae93cb34aa5d070d69ddbc02e6607 100644 (file)
@@ -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",
This page took 0.041715 seconds and 5 git commands to generate.