mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
Add log_error when strdup fails in {vg|lv}_change_tag().
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
parent
d01a6a2c5c
commit
f77fb62b2a
@ -723,7 +723,9 @@ int lv_change_tag(struct logical_volume *lv, const char *tag, int add_tag)
|
|||||||
|
|
||||||
if (add_tag) {
|
if (add_tag) {
|
||||||
if (!(tag_new = dm_pool_strdup(lv->vg->vgmem, 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)) {
|
if (!str_list_add(lv->vg->vgmem, &lv->tags, tag_new)) {
|
||||||
log_error("Failed to add tag %s to %s/%s",
|
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 (add_tag) {
|
||||||
if (!(tag_new = dm_pool_strdup(vg->vgmem, 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)) {
|
if (!str_list_add(vg->vgmem, &vg->tags, tag_new)) {
|
||||||
log_error("Failed to add tag %s to volume group %s",
|
log_error("Failed to add tag %s to volume group %s",
|
||||||
|
Loading…
Reference in New Issue
Block a user